Python Basics Guide
Python Basics Guide
1. Introduction to Python
Python is a high-level, interpreted programming language known for its simplicity and readability. It's
Variables store data. Common types: int (10), float (3.14), str ('hello'), bool (True/False), list, tuple,
dict.
3. Control Flow
4. Functions
def greet(name):
Lists store ordered data: [1, 2, 3]. Dicts store key-value pairs: {'name': 'Pretty', 'age': 20}
6. File Handling
content = file.read()
import math
print(math.sqrt(16))
8. Exception Handling
try:
x=1/0
except ZeroDivisionError: