voidex/20-29 Areas/20 Programming/20.01 Python/pythonSyntaxOverview.md

1.2 KiB

title tags aliases
pythonSyntaxOverview
python
syntax
overview
basics
python syntax
syntax reference
python basics

[!note] Overview of Python Syntax
Python emphasizes readability and simplicity. Its syntax is designed to be clean, consistent, and human-friendly.

Key syntax elements include:

  • Indentation instead of braces for code blocks
  • Colons : to begin blocks (like loops, functions, conditionals)
  • Comments start with # and are ignored by the interpreter
  • Snake_case for variable and function names
  • Whitespace matters for structure, not between expressions

[!example] Minimal Example

# This is a comment
def greet(name):
    print("Hello,", name)

if True:
    greet("Void")

[!tip] Syntax Philosophy

  • “There should be one — and preferably only one — obvious way to do it.” — The Zen of Python

[!info] Related Notes