Answered step by step
Verified Expert Solution
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
Open new Replit and create a file named LastNameFirstInitialHWPythonpy
For the first lines of your code. In the st line of code, write a comment with your full name, in the nd line of code write another comment with your pace email in it and the rd line of code write the date.
Import the random library, by adding import to the beginning of the code.
Create a variable myName and enter the value of your first name
Print myNames locker combinations are
Create a function called lockerCombo steps to be completed inside the function.
Create variables num num num
Generate a random number for each variable
Print out each the numbers to make the combination.
The locker combination is and the variables, with dashes between the numbers
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. num num and numnum 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
Outside the function, generate different combinations of the combination using a loop, and the loop should call the function created in step
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started