[Solved] Cheer creator | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

[Solved] Cheer creator

I decided to solve the cheer creator task using python. But my code doesn't work in the 3d test. Here is my code https://code.sololearn.com/cxL0q3nNUfL3/?ref=app

2nd Jan 2022, 9:45 PM
Kind_Cat
Kind_Cat - avatar
5 Answers
+ 4
There should be no exclamation mark after "High Five".
2nd Jan 2022, 10:48 PM
Simon Sauter
Simon Sauter - avatar
+ 1
In Ruby, 👇🏻 def cheer_for_team(yards) if yards > 10 return "High Five" elsif yards < 1 return "shh" else return "Ra!" * yards end end yards = gets.chomp.to_i result = cheer_for_team(yards) puts result
16th Jan 2024, 10:59 PM
SATYAM MORNINGSTAR
SATYAM MORNINGSTAR - avatar
0
Simon Sauter Just curious, would a version of this with chained conditional expressions be faster than the if-elif-else block?
3rd Jan 2022, 6:46 AM
Œ ㅤ
Œ ㅤ - avatar
0
Thanks, Simon Sauter That works
3rd Jan 2022, 10:19 AM
Kind_Cat
Kind_Cat - avatar
- 1
print("Ra!"*a)?? You're multiplying the "Ra!" with your input...is that what's needed, I can't remember.
2nd Jan 2022, 10:20 PM
rodwynnejones
rodwynnejones - avatar