Question: 7 . Define the createSecretCode ( numDigits ) function. Parameter: numDigits is an integer which determines the number of digits in the secret code list
Define the createSecretCodenumDigits function. Parameter: numDigits is an integer which determines the number of digits in the secret code list Return value: a list containing randomly selected integers between and inclusive and the length of the list is the numDigits parameter This function create a list of single digits. o Create a variable that initially holds an empty list.o Use a for loop with the range function to repeat based on the numDigits parameter. o In the loop, randomly select an integer between and inclusive and add it to the end of the list. o After the loop, return the list. o You will call this function in the main function.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
