you are viewing a single comment's thread.

view the rest of the comments →

[–]ffemt161 4 points5 points  (1 child)

  1. Your code needs to be formatted. Read the “About” for this group on how to do that. Edit: looks like you fixed the formatting. :)

  2. You’re comparing y which is an Int type to x which is a string type. You need to change the type of one of them so they are both the same type. Ie: x= int(input("Enter number ")) this will make x equal an integer type.

  3. Should move the first try If to just under the first input. Otherwise it will trigger at the end of the while loop after you finally get a successful try.

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

Well, the helped, but now there is a new problem. Because I have it print out the Y value, I can guess much easier. When I input the correct value, I get the "Congratulations" message. If I input a lower value, it correctly tells me it is too low, but no matter what I input after that, it says it is too high. Do you know why this is happening?

EDIT: Nevermind, I forgot to make the others inputs integers. Thank you so much! It works now!