WHY IS IT GIVING ME AN ERROR FOR "print()"

#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 re-enter")

Whenever you see a syntax error referencing a line that has no syntax error, look at the end of the line above it.

3 Likes