Can someone pls help me with this error🙏.It shows a sytrax error in elif although I put a semicolon. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can someone pls help me with this error🙏.It shows a sytrax error in elif although I put a semicolon.

if ti==10: print("Bomb explored") Elif ti>=11 print("Time is out,Someone has Hacked the Code") Else print("Wait")

1st Dec 2020, 8:55 AM
KADHM
KADHM - avatar
22 Answers
1st Dec 2020, 9:13 AM
Simba
Simba - avatar
+ 4
Ther is a collon(":") missing in front of elif statment and else statement
1st Dec 2020, 8:58 AM
Arsenic
Arsenic - avatar
+ 3
I think it must be like this Elf to>=11: print("...") Else: print("....") Indentations r missing
2nd Dec 2020, 11:14 PM
Web Sad
Web Sad - avatar
+ 2
K.A.D Helesh Madhuka Athukorala can you copy paste it on code playground and then share it here. Because right now there are some problems in your code ragarding indentation and typos.
1st Dec 2020, 9:08 AM
Arsenic
Arsenic - avatar
+ 2
yea, u guys arre very helpful.
2nd Dec 2020, 2:35 AM
chloeeee .
chloeeee .  - avatar
+ 1
Before I put elif it worked perfectly.
1st Dec 2020, 9:11 AM
KADHM
KADHM - avatar
+ 1
Thank you for helping Simba
1st Dec 2020, 9:18 AM
KADHM
KADHM - avatar
+ 1
Note:Putting a semicolon after the else statement. Python is case sensitive. Also I have forgotten to say that a conditional statement and every python statement should never start with caps.
1st Dec 2020, 5:30 PM
⚡V.M⚡
⚡V.M⚡ - avatar
+ 1
1. Python statements don't begin with capital letters; 2. The elif block is under the if block... I don't think that is what u wanted to do 3. There is no colon after the elif and else statements. Try this: ti = int(input()) print(ti) if ti == 10: print("Bomb exploded") elif ti >= 11: print("Time is out, someone has hacked the code") else: print("Wait")
1st Dec 2020, 7:49 PM
Kachi Emmanuel
Kachi Emmanuel - avatar
+ 1
Thank you guys for helping me.
2nd Dec 2020, 2:32 AM
KADHM
KADHM - avatar
+ 1
Your welcome we are always there to help you and others😊.
2nd Dec 2020, 2:33 AM
⚡V.M⚡
⚡V.M⚡ - avatar
+ 1
Simba thanks for asking this, coding is hard lol.
2nd Dec 2020, 2:34 AM
chloeeee .
chloeeee .  - avatar
0
I used collon but it did not work
1st Dec 2020, 9:06 AM
KADHM
KADHM - avatar
0
Sry I forgot to copy it but I defined "ti".
1st Dec 2020, 9:06 AM
KADHM
KADHM - avatar
0
So, what is the problem then?🤔
1st Dec 2020, 9:08 AM
KADHM
KADHM - avatar
0
Ok
1st Dec 2020, 9:09 AM
KADHM
KADHM - avatar
0
ti=int(input()) print(ti) if ti==10: print("Bomb explored") Elif ti>=11 print("Time is out,Someone has Hacked the Code") Else print("Wait") This is the full code
1st Dec 2020, 9:11 AM
KADHM
KADHM - avatar
0
I went through your link,but the error is a Syntax error/Invalid Syntax.
1st Dec 2020, 9:16 AM
KADHM
KADHM - avatar
0
I'll correct that mistake.
1st Dec 2020, 9:19 AM
KADHM
KADHM - avatar