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!

+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")

12/1/2020 8:55:13 AM

K.A.D.Helesh Madhuka Athukorala

22 Answers

New Answer

+9

There are some typos and indentation errors. Take a look at this lesson. https://www.sololearn.com/learn/Python/2278/ K.A.D Helesh Madhuka Athukorala Check what you missed https://code.sololearn.com/cXS82rmVhmXO/?ref=app

+4

Ther is a collon(":") missing in front of elif statment and else statement

+3

I think it must be like this Elf to>=11: print("...") Else: print("....") Indentations r missing

+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.

+2

yea, u guys arre very helpful.

+1

Before I put elif it worked perfectly.

+1

https://code.sololearn.com/cSgtUGd8o01I/?ref=app

+1

Thank you for helping Simba

+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.

+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")

+1

Thank you guys for helping me.

+1

Your welcome we are always there to help you and others😊.

+1

Simba thanks for asking this, coding is hard lol.

0

I used collon but it did not work

0

Sry I forgot to copy it but I defined "ti".

0

So, what is the problem then?🤔

0

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

0

I went through your link,but the error is a Syntax error/Invalid Syntax.

0

I'll correct that mistake.