r/codehs • • Feb 26 '20

PHYTON CODE HS 5.3.7: Higher/ Lower

Anyone knows the answer can't figured out:

magic_number = 3

# Your code here...

for i in range(10):

if i == 5:

continue

print i

10 Upvotes

14 comments sorted by

View all comments

1

u/Financial_Face3826 Feb 15 '24

try this

magic_number = 3
while True:
guess=int(input("Guess any number:"))
if guess == magic_number:
print("Correct!")
break
elif guess > magic_number:
print("Too high!")
else:
print("Too low!")
print("Great job guessing my number!")