1.1 What is Python?

Python is a powerful, high-level programming language designed with a focus on simplicity, readability, and versatility. It is used across various domains — from web development and data science to automation, artificial intelligence, and more.

Python lets you build more with less code. It’s often called the “Swiss Army Knife” of programming languages.

✅ Example:

# Simple Python program
print("Hello, World!")
    

🔑 Key Points:

1.2 The Very Basics

Python emphasizes code clarity. It uses indentation to define blocks instead of braces or keywords — making the code look neat and clean by default.

Python code often feels like writing English instructions.

✅ Example:

name = "Alice"
if name == "Alice":
    print("Hello, Alice!")
    

🔑 Key Points:

1.3 Invoking Python

You can use Python interactively or by writing scripts. It's versatile in how you execute your code, depending on the task at hand.

✅ Interactive Mode (REPL):

$ python
>>> print("Hello, Python!")
Hello, Python!
    

✅ Script Mode:

$ python my_script.py
    

✅ Shebang on UNIX/Linux:

#!/usr/bin/env python3
print("Running with shebang")
    

🔑 Key Points:

1.4 Basic Principles

Python is guided by design principles that prioritize readability, simplicity, and productivity. It promotes writing clean, logical code for small and large-scale projects alike.

"Simple is better than complex. Readability counts." — The Zen of Python

✅ Example: Exception Handling

try:
    number = 10 / 0
except ZeroDivisionError:
    print("You can't divide by zero!")
    

🔑 Key Principles: