0
Cheer Creator in Python.
Hey guys, I was attempting this easy question but seems like there is an error that I can't recognize. Thank you. Here is the question : https://www.sololearn.com/coach/20?ref=app And here is my code: yard=int(input()) if yard==10: print('High Five') elif yard>0 and yard<10: print(yard*'Ra!') else: print('shh')
11 Respostas
+ 3
if(yard< 1):
print("shh")
elif yard> 10:
print("High Five")
else:
print("Ra!"*yard, end='')
#do like this
+ 1
Hello Prakhar
Can you show us the question and your code?
+ 1
if(yard<1)
Print('shh')
Else
Print(yard*'Ra!')
#do this
+ 1
n=int(input())
i=1
if(n < 1):
print("shh")
elif n > 10:
print("High Five")
else:
print("Ra!"*n, end='')
i=i+1
# my code
+ 1
Denise Roßberg hello sir
Brackets are optional in python. It is advisable not to use them in python. But habituated with java. So you must be knowing
0
Denise Roßberg Yeah I just edited the post 😅
0
Atul There is also a condition for yards = 10.
0
This is the reworked code Atul ,
yard=int(input())
if yard>=10:
print('High Five')
elif yard<1:
print('shh')
else:
print('Ra!'*yard)
Still shows one of the tests as wrong... 4/5 are correct tho.
0
Denise Roßberg Alright 👍