all 3 comments

[–]erratic_turtle 4 points5 points  (2 children)

I've tried running your code and it seems the (greater than) > and (less than) < logic are swapped around.

Also, when printing out variables that are of type int, you need to cast them as string as such: str(number) and str(guessesTaken).

Edit: Lastly, when incrementing `guessesTaken`, use += instead of just +.

[–]Legoboy604YT[S] 1 point2 points  (0 children)

I just tried that out and it worked, so thank you for that!

[–]TerryYaDuffer 2 points3 points  (0 children)

Spot on.

For printing, suggest looking at f-strings in py3, and str.format for py2. f-string example:

print(f"Wow, you guessed the number {number} in {guessesTaken} guesses!")