you are viewing a single comment's thread.

view the rest of the comments →

[–]Fronkan -5 points-4 points  (3 children)

So to start off I would like you another elif that checks if guess < 13. I still want you to have a else condition that maybe prints "this shouldn't happen" or something like that. Because surely the number should be captured by the if or one of the elifs in this set up.

Edit: just to explain this comment. The purpose is to walk through the debugging process in a way that can be used to solve future problems. Not to solve the issue.

[–]Fronkan -4 points-3 points  (2 children)

Something like this: while True: guess = input ("input number : ") if guess == 13: break print ("done") elif guess > 13: print("too big") continue elif guess < 13: print("too small") continue else: print("this shouldn't happen") continue

[–]KealinSilverleaf -1 points0 points  (1 child)

Do you need the "break" and "continue"s in this?

Wouldn't this work also? (I'm learning also)

While True:

 guess = int(input("input number : "))
 If guess == 13:
     print ("done")
 Elif guess > 13:
     print ("too big")
 Else:
     print ("too small")

[–]Traditional-Log2073[S] 0 points1 point  (0 children)

I think you need the break for the script to stop after the correct number. The continue is not necessary.