Python Forum

Full Version: "SynatxError" Invalid Syntax Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, as I am writing my program, i wrote the code

x = 10
if x < 100

from here python automatically gives me the following message

SyntaxError: invalid Syntax

I tried switching the "<" around but it I still get the error and I also tried indenting the if statement, which gives me

SyntaxError:unexpected Indent

Can someone please tell what what is going on and how to solve this issues - Thanks in advance

PS: I am just building a program to build my skill (if someone is wondering why I am using that code)
You need a colon at the end of the line with the if statement. Then the code after if is indented.

x = 10
if x < 100:
    print('Puny number.')
else:
    print('Number smash!')
Thank you!