Intro to Scripting/Python – Assignment 3
In this assignment, you will write a custom module using a standard random module and functions.
Write a module named rand_str.py which imports a random module and has three functions:
Function 1:
• Takes two parameters, a string and a seed value (optional parameter).
• If seed value is passed, use passed value as a seed, if it is not passed, use None as a seed.
• If passed string has only 1 word, return a random character from the string.
• If passed string has two or more words, return a random word from the string.
Function 2:
• Takes two parameters, a string and a seed value (optional parameter).
• If seed value is passed, use passed value as a seed, if it is not passed, use None as a seed.
• If passed string has only 1 word, return the mix of characters.
• If passed string has two or more words, return the mix of words.
Function 3:
• Takes three parameters, two positive integers and a seed value (optional parameter).
• If seed value is passed, use passed value as a seed, if it is not passed, use None as a seed.
• If the first parameter is less than the second parameter, it should return a random integer between first parameter and second parameter.
• If the first parameter is greater than the second parameter, it should return a random integer between second parameter and first parameter.
Write a python file main.py and import the rand_str module. In the main.py, call the functions from rand_str module and print the return values as:
1. Call the function 1 and pass “Python” as string parameter without seed value.
2. Call the function 1 and pass “Python is a scripting language. It provides many standard and third-party libraries.” as string parameter with seed value 42.
3. Call the function 2 and pass “Python is a scripting language. It provides many standard and third-party libraries.” as string parameter without seed value.
4. Call the function 2 and pass “Python” as string parameter with seed value 42.
5. Call the function 3 and, pass 99 and 999 as integers without seed value.
6. Call the function 3 and, pass 999 and 99 as integers with seed value 42.
7. Print the return values of all the function calls.
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme