Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions