Syntax Error in Python

Syntax Errors Also Known As Parsing Errors Are Most Common Errors While Learning Python 2 Or Python3.

It Mostly Looks Like This:


SyntaxError: invalid syntax

It Mostly Occurred because of A One Single Symbol At Most Not Only But Mostly Which is ":" a colon symbol for if, elif and else statement, While Do While And For Loop Of The Python Program For Example


This Code:

>>> while True print("Hello World")

 File "<stdin>" line 1

  while True print("Hello World")

           ^

SyntaxError: invalid syntax


At Here We Forgotten To Add The Colon Symbol after The True And Also Didn't Add The Statement On New Line Also

Comments