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
5 Antworten
+ 4
There should be no exclamation mark after "High Five".
+ 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
0
Simon Sauter Just curious, would a version of this with chained conditional expressions be faster than the if-elif-else block?
0
Thanks, Simon Sauter
That works
- 1
print("Ra!"*a)??
You're multiplying the "Ra!" with your input...is that what's needed, I can't remember.