Jan-19-2021, 04:40 PM
(This post was last modified: Jan-19-2021, 04:40 PM by deanhystad.)
You have the while loop in the wrong place. You are supposed to prompt the user for input until then enter a number between 1 and 10. You politely request them to do so, but nothing in you program enforces the thing they enter is a number, much less a number from 1..10.
Your program should look something like this:
num = get input # <- You have a good start, but what if user enters 'one'?
if num in range 1 to 10 # <- You have not done anything to test this
Your program should look something like this:
while True: num = get input if num in range 1 to 10 break print('&'*num)Now go figure out these parts:
num = get input # <- You have a good start, but what if user enters 'one'?
if num in range 1 to 10 # <- You have not done anything to test this