I’m making a number generator and I want forums to help me. I want the user to be able to change how big the number generator can be. right now you have to put how many digits the max can be. Here’s what I got:
#you need to write the whole word "yes" or "no" for it to work.
from random import randint
while True:
max_number_of_digits = 10
num_of_digits = randint(1, max_number_of_digits)
num = randint(1, int("1" + ("0" * num_of_digits)) )
print(" ")
print(" ")
print("Welcome To Number Generator.")
print("Would You Like To Get A Number?")
answer = input("Enter yes or no: ")
if answer == "yes":
print(num)
elif answer == "no":
print("So why did you open the program!?")
else:
print(" ")
print(" ")
print("please go back to 4th grade and try again")