First a big thank you for everyone's help thus far as I've been working on learning the fundamentals of Python and an additional thank you for helping when my questions are often related to projects I am doing outside of the CA exercises.
So I am trying to create a program that asks the user to guess a number that will allow them to continue guessing until they guess the correct answer. However I am really stuck on getting the program to execute properly. I either am unable to get it to loop or I end up creating an infinite loop. If anyone could give me a hint or steer me in the right direction as to where I am messing this code up that would be greatly appreciated.
from random import randint randomNum = randint(1,100) name = input("What is your name? ") print("Nice to meet you " + name + ".") print() guess = input("Please guess a number between 1 and 100: ") while True: if (int(guess) > int(randomNum)): print("Im sorry " + name + " your guess is too high.") elif (int(guess) < int(randomNum)): print("Im sorry " + name + " your guess is too low.") elif guess == int(randomNum): break print("Yes " + name + " that is correct!") print()