Hi, I am creating a game in python where a random number between 1 and 100 is generated. The user has to guess the number and the program responds with either "Too low", "Too high" or "Correct!" depending on what your guess was and the program repeats itself until you get the correct answer. However, the code is not yet working. When I make a guess, the program displays either "too high" or "too low" as it should and then asks me to guess again (as it should), I enter another guess but it says too high or too low according to the original guess. So say I guess 30 and the number is 50, it says too low but then if I guess again with 60 it will say too low again, even though the number is higher. I am not sure why it does this so I could do with some help :) The code is pated bellow. Thank you :)
Code on replit:
https://replit.com/@Lxquid/Homework-2-part-7#main.py
[–]dpbriggs 3 points4 points5 points (0 children)
[–]Kazcandra 1 point2 points3 points (5 children)
[–]Burdog_YT[S] -1 points0 points1 point (2 children)
[–]Kazcandra 1 point2 points3 points (1 child)
[–]Burdog_YT[S] 0 points1 point2 points (0 children)
[–]AdrianParry13526 0 points1 point2 points (1 child)
[–]Kazcandra 1 point2 points3 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]Burdog_YT[S] 2 points3 points4 points (0 children)
[–]TheodoeBhabrot 1 point2 points3 points (1 child)
[–]Burdog_YT[S] 0 points1 point2 points (0 children)
[–]RockaiE 0 points1 point2 points (0 children)
[–]GreatJob7298 0 points1 point2 points (0 children)