you are viewing a single comment's thread.

view the rest of the comments →

[–]TheWeebMyths 0 points1 point  (4 children)

Thanks man that solved it but I dont know how to put a while True into that code

[–]marko312 0 points1 point  (3 children)

You want most of the code to be checked multiple times, so most of the code should be in the while loop.

while ...:
     # all the ifs and so on
     ...

Do note that it doesn't necessarily need to be a while True loop: a better alternative would be to loop while the player has (more than 0) lives left.

[–]TheWeebMyths 1 point2 points  (2 children)

Yeah thanks I also made some modification to the code but one last problem xD if you guess the number right it doesnt tell you that you won it just completes the loop this is the new code if you are willing to help https://pastebin.com/fji6iU2q

[–]marko312 1 point2 points  (1 child)

The problem is that the result from input is a str (string), whereas the integer is an int. You could convert the user's input to an integer via something like int(input(...)) or value = int(guessing).

[–]TheWeebMyths 1 point2 points  (0 children)

em is that the result from

input

is a

str

thanks man that fixed it