+ 1
Someone explain!!
In this Cheer creator question, My code is almost right except last else statement....how do I print Ra!Ra!Ra!Ra!...... should I use loop??....I did that but not working properly. https://code.sololearn.com/cKqiP09IWF6t/?ref=app
5 Respostas
+ 3
yard = int(input())
if yard > 10:
print("High Five")
elif yard < 1:
print("shh")
else:
print("Ra!"*yard)
if yard is bigger than 10 (no matter how big, it tends to infinity) it will print 'high five'
if yard is smaller than 1 (no matter how small, it tends to -infinity) it will print 'shh'
else means if the number is between 1 and 10, it will print 'ra!'. * yard means print the same string how many times the yard number represnents
+ 2
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 Thanks for the hint! i didn't read the string multiplication properly, i edited now! Thanks again!!
+ 1
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 Got you brother 👍🏻