0

This is my code for cheer creator and in don't know why it's goes error in test #4,help me please,thanks...

str = (input()) if int(str) > 10: print("High Five") elif int(str) > 1 and int(str) < 10: print("Ra!" * (int(str))) elif int(str) < 1: print("shh") It's solved.

17th Feb 2022, 11:34 PM
mdnk
3 Réponses
+ 3
mehrdad nka What happens if you make 1 yard or 10 yards? Your code doesn't handle these conditions. Hint: >=, <= Also, str is a function which turns an int/float into a string, so you might wish to rename that variable to something meaningful, like num. Just to clean your code up a bit, why not create num as an integer during the input section, then the rest of your code will be easier num = int(input())
17th Feb 2022, 11:41 PM
Rik Wittkopp
Rik Wittkopp - avatar
+ 2
It's solved...thanks 😬
17th Feb 2022, 11:42 PM
mdnk
+ 2
G'day mehrdad nka how cool is it that you were so close to having it solved by yourself! Keep up the great work. Would you mind editing the Q&A tag to say which language you are working with (python is so much less painful than C) other might find your post in their search and get the answer they were looking for. You could also add [solved] to your Q&A question.
18th Feb 2022, 4:31 AM
HungryTradie
HungryTradie - avatar