random number

so im trying to get the code to run until the user guesses the right number, but for some reason, even if the user guesses the right answer, it still says "sorry that was wrong" (or whatever i put in the code) any ideas why it isnt printing the "congradulations" ?

You are viewing a single comment. View All

Inputs are always in the form of a string, even if they are numbers. You are trying to compare a string and an integer, so they never match. Either convert the input into an integer or convert the random number into a string and then compare them.