0

a=int(input()) if a>10: print("High Five") elif a<10 and a>0: for i in range(0,a): print("Ra!") elif a<1: print("shh")

I'm passing 4 test cases but one hidden test case is failing can anyone help me

25th Apr 2020, 4:51 AM
Dhavish kakirde
Dhavish kakirde - avatar
12 Answers
+ 2
Dhavish kakirde if a >= 10: elif a < 10 and a >=2: elif a <= 1 https://code.sololearn.com/ceg3XtKOa4V2/?ref=app
25th Apr 2020, 6:04 AM
BroFar
BroFar - avatar
+ 1
Think about this Dhavish kakirde as one or less yards shh and ten or more is high five ...
25th Apr 2020, 5:01 AM
BroFar
BroFar - avatar
25th Apr 2020, 5:00 AM
Dhavish kakirde
Dhavish kakirde - avatar
0
Thanku sir i've craked it... i have to take a<= 10 on second elif...thanku very much
25th Apr 2020, 6:00 AM
Dhavish kakirde
Dhavish kakirde - avatar
0
#example yards = int(input()) print('High Five' if yards > 10 else 'shh' if yards < 1 else 'Ra!' * yards)
26th Apr 2020, 7:43 AM
Jonathan Alvarado
Jonathan Alvarado - avatar
0
I think you are missing 10: If a>=10 ... Or... Elif a<=10
26th Apr 2020, 9:51 PM
Pablo Correa
Pablo Correa - avatar
0
I think you are missing 10: If a>=10 ... Or... Elif a<=10
26th Apr 2020, 9:53 PM
Pablo Correa
Pablo Correa - avatar
0
The for loop will get only 9 numbers from 0 to 10. If we use the 10 as input we will get an errorâ˜ș
26th Apr 2020, 10:28 PM
sri krishna
sri krishna - avatar
0
a>int{input=High five;}
27th Apr 2020, 2:54 AM
kada rebaoui
kada rebaoui - avatar
- 1
I've tried it also but it didn't work, i'm unable to find the error
25th Apr 2020, 5:07 AM
Dhavish kakirde
Dhavish kakirde - avatar
- 1
For this senerio, if a=10 then this not lies in any condition so it goes to else condition and there is not any decided code so nothing is print. But, if you wnt to print different for only a=10, then add the condition else and print the value you want.
26th Apr 2020, 1:52 PM
Shubham Khanuja
Shubham Khanuja - avatar
- 1
It will be elif a<=10 and a>=1 : Or you will not get result for 10 And you will get 'Ra!' If the input is 0.5 instead of 'Shh' And you won't need the for loop if you write print("Ra!"*a) Just easier method😉
26th Apr 2020, 3:32 PM
Ayan Das
Ayan Das - avatar