Python Syntax

Python syntax refers to the rules that define how a Python program is written and interpreted. Python syntax is simple, readable, and beginner-friendly.

💡 Python focuses on readability — code looks almost like plain English.

Basic Python Syntax

print("Hello, Python!")

Indentation in Python

Python uses indentation instead of braces { } to define blocks of code.

if 5 > 2:
    print("Five is greater than two")
❌ Incorrect indentation will cause an error

Case Sensitivity

Python is case-sensitive.

name = "Python"
Name = "Programming"
print(name)
print(Name)

Practice

  1. Write a simple print statement
  2. Use indentation in an if statement