Ask coding questions

← Back to all posts
Program not accepting equal values?
TheFlooBearer (7)
Python File, if the URL didn't give that way.
This is my code. I am trying to make a game that allows you to guess a number from 1 to 10. It doesn't seem to be working when I test it. If I print the [number] variable and then insert that variable into the guess, it seems to not detect that was the right value. I tend to make incredibly small errors, so, bear with me.

Answered by SixBeeps (2827) [earned 5 cycles]
View Answer
SixBeeps (2827)

input() returns a string, but the number is an integer. Use int(guess1) == number and int(guess1) != number and tries >= 1 instead.

TheFlooBearer (7)

@niorg2606 Thank you so much! That makes sense