Gotham city challenge, I have problem with the code, I type but still return error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 14

Gotham city challenge, I have problem with the code, I type but still return error

c=int(input()) If c<5: print ('i got this!') elif 4<c<11: print ('Help me Batman!') else: print ('Goodluck out there!')

14th May 2020, 12:28 PM
kabir ibrahim
kabir ibrahim - avatar
50 Answers
+ 6
Give me 5 upvotes plz 🙏
16th May 2020, 10:12 AM
Sultan
Sultan - avatar
+ 5
Try in the elif statement, spreading it out by using "and" elif c > 4 and c < 11:
14th May 2020, 12:31 PM
Slick
Slick - avatar
+ 5
Makayla Harries Q/A section is for discussion and clearing your doubts. What you are doing is pure spam. don't do it
29th May 2020, 7:14 AM
Mehnaz ✨
Mehnaz ✨ - avatar
+ 3
Just remove the extra !
16th May 2020, 12:03 PM
xkcd
xkcd - avatar
+ 3
#if stament has to in lower case c=int(input()) if c<5: print ('i got this!') elif 4<c<11: print ('Help me Batman!') else: print ('Goodluck out')
16th May 2020, 12:24 PM
Moaaz Osman
Moaaz Osman - avatar
+ 2
c=int(input(:)) if c<5: print("I got this!") elif 4<c&&c<11: print("Help me Batman!") else: print("Good luck out there!") #try that i think it can solve your problem
14th May 2020, 9:40 PM
Gordon Okoth Agola
Gordon Okoth Agola - avatar
+ 2
U hv to write If in small letter that is (if)
16th May 2020, 8:43 AM
Yeabsera 🇪🇹
Yeabsera 🇪🇹 - avatar
+ 1
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 youre right its definitely not. I just checked mine and I used all "if statements" as well
14th May 2020, 12:46 PM
Slick
Slick - avatar
+ 1
Thanks Kiibo, it works. The output must be exactly as what they expected. I got it now. Thanks much
14th May 2020, 2:57 PM
kabir ibrahim
kabir ibrahim - avatar
+ 1
Oooh nice
14th May 2020, 10:08 PM
Gordon Okoth Agola
Gordon Okoth Agola - avatar
+ 1
The expression should be inside the parentheses () Also, the second expression should be elif(c>=5 and c<=10):
15th May 2020, 3:52 AM
Bot
Bot - avatar
+ 1
If its python. If needs to be if(lowercase) and instead of 4<c<11 write elif 4>c and(||) c<11 And if the c is not in between those values it will say error(else will execute in this case)
15th May 2020, 2:28 PM
Ilhan
Ilhan - avatar
+ 1
,😄✌️
15th May 2020, 2:56 PM
shreyansh jain
shreyansh jain - avatar
+ 1
n=int(input()) if n<5: print("I got this!") elif n>=5 and n<=10: print('Help me Batman') else:print("Good Luck out there!") Just copy paste this...👍.
15th May 2020, 7:18 PM
Vinay Pal
Vinay Pal - avatar
14th May 2020, 12:52 PM
Sanjyot21
Sanjyot21 - avatar
0
Thanks so much all. Really appreciate
14th May 2020, 1:02 PM
kabir ibrahim
kabir ibrahim - avatar
0
Guys am still having issue with the first line of code as follows c= int(input()) The 'int' and 'output' are not coming out as function. What should I do pls
14th May 2020, 1:10 PM
kabir ibrahim
kabir ibrahim - avatar
0
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 I'm not talking about the 'if', I'm saying about the print statement which that 'if' condition will print. Since you are running that code in code coach they want you to execute the code according to there norms...
14th May 2020, 2:46 PM
Sanjyot21
Sanjyot21 - avatar
0
OK, how am I gonna do then
14th May 2020, 2:47 PM
kabir ibrahim
kabir ibrahim - avatar