Introduction

Python is a high-level, interpreted programming language known for its readability and ease of use.

It is widely used in web development, data science, AI, and scripting tasks.

print("Hello, Python!")
Variables

Variables store information in Python. You do not need to declare the type explicitly.

Use the assignment operator (=) to assign values.

x = 10 name = "Alice"
Data Types

Python supports multiple built-in data types such as integers, floats, strings, lists, and dictionaries.

You can check data types with the type() function.

type(42) # int type(3.14) # float type("Hi") # str
Control Flow

Python uses indentation instead of braces for blocks.

Control structures include if/else, for loops, and while loops.

if x > 5: for i in range(3): while condition:
Functions

Functions are defined using the def keyword.

They help organize reusable blocks of code.

def greet(name): return "Hello " + name
Modules

Modules allow you to organize Python code across multiple files.

You can import built-in or custom modules.

import math print(math.sqrt(16))