In: Computer Science
Write a Python program that has a loop to continuously ask the user for a number, terminating the loop when the number entered is -1.
Inside the loop,
1.) display one asterisk(*) if the number is 1,
2.) two asterisk(**) if the number is 2 and
3.) "OTHER" if the number is any other number.
PYTHON PROGRAM :-
num = int(input("Please enter a number and -1 to stop
\n"));
while num!=-1:
if num == 1:
print('*')
elif num == 2:
print('**')
else:
print("OTHER")
num = int(input("Please enter a number and -1 to stop
\n"));
Output with program indentation screenshot :-