Home / Python / Day 1: Python Basics / Python Syntax

Python Syntax

Python syntax rules including indentation, statements, and basic structure.

Python Syntax Rules

Python has strict but simple syntax rules that make code consistent and readable.

Indentation

Python uses indentation to define code blocks. The standard is 4 spaces. Mixing tabs and spaces causes errors.

Statements

Each line is a statement. Long statements can span multiple lines using backslash \ or parentheses.

Case Sensitivity

Python is case-sensitive: name, Name, and NAME are three different variables.