Anant M. answered 12/18/22
Computer science University student with 4+ years experience in python
import random
random.seed(900)
def number_guesser(nums):
for n in nums:
#Generates a random number every iteration
randomNum = random.randint(1,100)
if randomNum == n:
#If it is the correct number
print(f"{n} is correct!")
elif (randomNum > n):
#If the random number is greater
print(f"{n} is too low. Random number was {randomNum}.")
else:
#If random num is smaller
print(f"{n} is too high. Random number was {randomNum}.")
number_guesser([32, 45, 48, 80])
Above is the code for the following problem, you can change the speed to whatever you want according to the problem