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
12 ответов
+ 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
+ 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
25th Apr 2020, 5:00 AM
Dhavish kakirde
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
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
0
I think you are missing 10: If a>=10 ... Or... Elif a<=10
26th Apr 2020, 9:51 PM
Pablo Correa
0
I think you are missing 10: If a>=10 ... Or... Elif a<=10
26th Apr 2020, 9:53 PM
Pablo Correa
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
0
a>int{input=High five;}
27th Apr 2020, 2:54 AM
kada rebaoui
- 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
- 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
- 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
Актуальное сегодня