0
So close but so far... Help?
Brand new to python but I have been working on some of the easier coding challenges. I am so close to having this one beat for the Cheer Creator challenge but I fail on test 4. What am I missing? https://code.sololearn.com/cYWTjXUiNY1j/?ref=app
15 ответов
0
whats the challenge
0
You are cheering on your favorite team. After each play, if your team got over 10 yards further down the field, you stand up and give your friend a high five. If they don't move forward by at least a yard you stay quiet and say 'shh', and if they move forward 10 yards or less, you say 'Ra!' for every yard that they moved forward in that play.
Task
Given the number of yards that your team moved forward, output either 'High Five' (for over 10), 'shh' (for <1), or a string that has a 'Ra!' for every yard that they gained.
Input Format
An integer value that represents the number of yards gained or lost by your team.
Output Format
A string of the appropriate cheer.
Sample Input
3
Sample Output
Ra!Ra!Ra!
0
Thank you both. Seems so obvious but it really had my head swirling.
0
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 i think that should solve thr challenge
0
im just saying u already solved the challenge
0
Change your code to:
yards= int(input())
i= yards
if i < 1 :
print("shh")
elif i > 10 :
print("High Five")
else:
print("Ra!"* i)
0
n = int(input())
if n>10:
print('high five')
elif n<1:
print('shh')
else:
print('Ra!'*4)
0
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 so wats the solution
0
The last line has to print("Ra!"*i) for Ra to be printed once for each yard (I)