Someone help me, i can't find any error(it's correct for all the five test except one) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Someone help me, i can't find any error(it's correct for all the five test except one)

yard = int(input()) if yard < 1: print("shh") if yard >= 1 and yard <= 10: print("Ra!" * yard) else: print("High Five" * yard)

19th Jul 2021, 7:32 AM
Ejeh Joseph
Ejeh Joseph - avatar
6 Answers
+ 2
print("High Five") It's not necessary to multiply with yard Also, your second statement should be elif not if elif yard >= 1 and yard <= 10:
19th Jul 2021, 7:43 AM
Simba
Simba - avatar
+ 1
# output either 'High Five' (for over 10), 'shh' (for <1), or a string that has a 'Ra!' for every yard that they gained. print("High Five") is enough inplace of your last line.
19th Jul 2021, 7:44 AM
Rohit
+ 1
Oh! Thanks Simba
19th Jul 2021, 7:49 AM
Ejeh Joseph
Ejeh Joseph - avatar
+ 1
Cherrim thanks alot
19th Jul 2021, 7:49 AM
Ejeh Joseph
Ejeh Joseph - avatar
+ 1
#1 output either 'High Five' (for over 10) #2 'shh' (for <1) #3 a string that has a 'Ra!' for every yard that they gained. Designed your if elif else statements accordingly and you are good to go. Welcome.
19th Jul 2021, 8:01 AM
Rohit
+ 1
Yeah!! I got it Cherrim , you're good bro...
19th Jul 2021, 8:46 AM
Ejeh Joseph
Ejeh Joseph - avatar