I'm a complete newbie to code in general and was wondering if someone could help me out with an error I keep getting.
I have been getting am error on the line "if guess > number:"
If anyone could help out with a solution that would be great! Thanks :D
# a game where you guess a number between 1 and 10
import random
number = random.randint(1,10)
# import random module
print("I am thinking of a number between 1 and 10 you have to guess")
guess = int(input("Enter your guess here:")
# users input is placed in a variable and turned into an int
if guess > number:
print("Guess lower...")
# If the guess is higher than the number user is told to guess lower
elif guess < number:
print("Guess higher...")
# If the guess is lower than the number user is told to guess higher
elif guess == number:
print("You guessed right, you win!")
# if user guesses correctly the user is congratulated
fin = input ("Press enter to close program.")
Posted Dec 16, 2018, 11:05 PM UTC