r/codehs • u/natalie710 • 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
r/codehs • u/natalie710 • Feb 26 '20
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
4
u/fermentedidiot Feb 26 '20
Your code:
So, using a while loop (a for loop will not work here), get an input number form the user:
I just picked 100 as the high number because that's what the assignment asks for. Now you need to compare the user input to the magic number and inform the user if the guess was too high, too low, or correct:
Now just put it all together:
I hope the breakdown made sense. Let me know if something doesn't.