+1

Still stuck at the if statement part..i keep getting syntax error: invalid syntax for typing this..

x= int(input("Scores")) if x==20: print("good") else: print("bad") print("program ended") Is there any error in this code? and help me check the indent too.Thanks

7/5/2019 11:28:27 AM

Ayo Ashaolu

6 Answers

New Answer

+2

Ayo Ashaolu You should tell such information earlier ! Anyways after you type print("bad") and press enter there will be 3 dots on next line. Press enter there, it's required for the interpreter to know the end of if-else block. The code will print "good" or "bad" depending on what you entered earlier. then you type the last line print("program ended")

+1

This program works perfectly. If you could share your actual code, we might be able to help you find your problem

+1

Thats the actual code..python

+1

But it works.. At least can you tell me what the error message is or what line is it on?

+1

Ayo Ashaolu Works fine in codeplayground. Your code has 2 space intendation, try with 4 space in your editor (though it should not matter as intendation is consistent)

+1

The error is on that print(program ended) line.. i am typing it on console.. How will the output look like