Question: write this code 1 Open new Replit and create a file named LastNameFirstInitialHWPython 4 . py 5 2 For the first 3 lines of your

write this code
1
Open new Replit and create a file named LastNameFirstInitialHWPython4.py
5
2
For the first 3 lines of your code. In the 1st line of code, write a comment with your full name, in the 2nd line of code write another comment with your pace email in it, and the 3rd line of code write the date.
5
3
Import the random library, by adding import to the beginning of the code.
5
4
Create a variable (myName) and enter the value of your first name
5
5
Print (myName)s locker combinations are
5
6
Create a function called lockerCombo(), steps 7-10 to be completed inside the function.
5
7
Create 3 variables (num1, num2, num3)
10
8
Generate a random number for each variable (0-39)
5
9
Print out each the 3 numbers to make the combination.
The locker combination is and the 3 variables, with dashes between the numbers
5
10
The program should tell the user if the combination numbers generated are valid or not by outputting the following options:
Check to make sure the consecutive numbers match or not. (num1!= num2) and (num2!=num3) The combination cant work if the numbers match consecutively.
Output: This combination will work, or Please try again, this is not a valid combination, the sentence should be tabbed over using the \t command in the print statement
HINT: use the and command to compare multiple conditions together
20
11
Outside the function, generate 4 different combinations of the combination using a loop, and the loop should call the function created in step 6

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!