Question: Create a function called howManyUntil(stopNum) where stopNum is an integer from 0 and 99 The function will randomly generate a number from O and 99
Create a function called howManyUntil(stopNum) where stopNum is an integer from 0 and 99 The function will randomly generate a number from O and 99 and keep generating random numbers until the number stopNum is generated. The function will return the number of random numbers that were generated in order to get the stopNum. Example: If stopNum = 50 and the random numbers generated were 0, 4, 19, 50, then the function would return 4. Save & Run Load History Show CodeLens Share Code 1 # Your Name: 2 import random 3 4 # define howManyuntil function 5 6 # call it to test it out 7 # to test it you may want to make 8 # and prints out the random number 9 10 Problem: 5 -- ActiveCode (hs 82)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
