+ 1
[CODE COACH] Cheer creator
Somebody help me out plz I just want to solve this problem by using basics of python only. My attempt: import math n=int(input()) m=math.fabs(n) if n>0: print("Ra!"*n) else: print("shh") but 1 it is not working for 1 test out of 5 tests https://www.sololearn.com/coach/20?ref=app
8 Respostas
+ 3
You are thinking too complicated.
Just model step by step what the task tells you, you don't need to look for hacks.
What if <1? What if in between? What if >10?
+ 2
The point of these problems is to train your problem-solving skill.
Giving you the solution would destroy their purpose.
Have you tried to do it on your own? Can you show us your attempt? We may give you a hint.
+ 2
Tysm HonFu
I got this
overthinking is bad ✌
+ 1
HonFu
see I had tried
code:
import math
n=int(input())
m=math.fabs(n)
if n>0:
print("Ra!"*n)
else:
print("shh")
but 1 it is not working for 1 test out of 5 tests
+ 1
You are missing a complete case.
What's with the condition for >10?
+ 1
thanks Yashshree Patil
0
HonFu
still not working... 🥵
n=int(input())
if n>0 and n<10:
print("Ra!"*n)
elif n%10==0:
print("shh")
elif n%10>0:
print("Ra!"*(n%10))
else:
print("shh")
0
def prob(move):
if(move<1):
print('shh')
elif(move>10):
print('High Five')
else:
n = 'Ra!'*move
print(n)
prob(int(input()))
#All 5 test cases work with this code and is easy to understand