0
Cheer creator
n=int(input()) if n<1: print("shh!") for i in range(1,n+1): print("Ra!") if n>10: print ("High Five") What is the mistake in this
5 Réponses
+ 1
your for loop must be in an if statement.
if n<1:
print('shh')
elif n<=10:
for i in range(n):
print('Ra!', end='')
else:
print('High Five')
the for loop can also be replaced by
print('Ra!' *n)
+ 3
Take help of this code...
n=int(input(""))
if n<1:
print("shh")
elif n>=1 and n<11:
print("Ra!"*n)
else:
print("High Five")
your for Loop runs every time...it should be inside elif
+ 1
First, it's 'shh' not 'shh!'
The for loop doesn't check any condition i.e if the input is 11 it prints both 'Ra' *11 and high five
0
Try
n=int(input())
If n in range(1,11):
print("Ra!"*n)
0
Thanks to all