0
I'm not really good at while loops anyone mind giving me a hand with my code?
while (guess != secret): if too high else (too low)
3 ответов
0
guess = int(input())
while (guess != secret):
    if guess < high:
        print("too low")
    else:
        print("too high")
    guess = int(input())
print("guessed!")
# or shorter:
guess = int(input())
while (guess != secret):
    print("too low" if guess < secret else "too high")
    guess = int(input())
print("guessed!")
0
Thank you so much!
0
just a little update (forgotten else in shortest alternative)



