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
12 Answers
+ 2
Dhavish kakirde
if a >= 10:
elif a < 10 and a >=2:
elif a <= 1
https://code.sololearn.com/ceg3XtKOa4V2/?ref=app
+ 1
Think about this Dhavish kakirde as one or less yards shh and ten or more is high five ...
0
Thanku sir i've craked it... i have to take a<= 10 on second elif...thanku very much
0
#example
yards = int(input())
print('High Five' if yards > 10 else 'shh' if yards < 1 else 'Ra!' * yards)
0
I think you are missing 10:
If a>=10
...
Or...
Elif a<=10
0
I think you are missing 10:
If a>=10
...
Or...
Elif a<=10
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âșïž
0
a>int{input=High five;}
- 1
I've tried it also but it didn't work, i'm unable to find the error
- 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.
- 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đ