I am trying to make a simple guessing game. When I run the code and print the number in advance to check if the program is working, it keeps on having the same wrong response. In other words, even if the guess variable is equal to the num
variable, the program still returns "Incorrect!", and I can't figure out why. Thank you in advance. The code is pretty self-explanatory, so I'll post it here.
import random
num = random.randint(1, 6)
print(num)
guess = input(f'Guess a number: ')
if guess == num:
print(f'Correct!')
else:
print(f'Incorrect!')