This code:
import random
print("\tWelcome to the guess my number program\n")
print("im thinking of a number between 1 and 100")
print("try to guess it in 5 attempts\n")
randomNum = random.randint(1,101)
tries = 0
userNumber = int(input("please pick a number"))
while userNumber != randomNum:
if userNumber > randomNum:
print ("lower")
else:
print("higher")
tries += 1
print ("you guessed it! the number was" , randomNum)
For some reason this produces an infinite loop. Any help, im still getting used to python.
IndentationError. :)tries, but you apparently forgot to do anything with it - like preventing more than 5 tries or at least printing back how many guesses it took the user.