+ 2

Help me!!!(Gotham City!) - Code coach(EASY)😭

Whats wrong in this code... x = int(input()) if 0<x<5: print("I got this!") elif 5<=x<=10: print("Help me Batman") elif x > 10: print("Good Luck out there!")

26th Oct 2020, 1:56 AM
Rohit Anand
6 Answers
+ 2
It's showing 1 wrong case in the hidden case...
26th Oct 2020, 1:57 AM
Rohit Anand
+ 2
Isn't 4<n<11 also same as 5<=n<=10??
26th Oct 2020, 2:08 AM
Rohit Anand
+ 1
In your code n doesn't accounts for 0 as you have 0<n<5. It should be 0<=n<5 or simply n<5.
26th Oct 2020, 3:02 AM
abhinav
abhinav - avatar
0
Same for integer n
26th Oct 2020, 2:55 AM
abhinav
abhinav - avatar
0
a=int(input()) if a<5: elif a<11: else:
26th Oct 2020, 2:57 AM
abhinav
abhinav - avatar
0
p = int(input()) if p < 5: print('I got this!') elif p >= 5 and p < 10: print ('Help me Batman') else: print ('Good Luck out there!')
27th Oct 2020, 1:24 PM
Pavel O
Pavel O - avatar