Python Crash Course
1. Introduction
• Python is an interpreted, high-level, general-purpose programming language.
• It is beginner-friendly and widely used in web development, data science, automation, and
more.
2. Basics
• Print: print('Hello, World!')
• Variables: x = 10, name = 'Alice'
• Data types: int, float, str, bool, list, tuple, dict, set
3. Control Flow
• If-Else: if x > 5: print('Big') else: print('Small')
• Loops: for i in range(5): print(i)
• While loop: while x > 0: x -= 1
4. Functions
• def greet(name): return f'Hello {name}'
• print(greet('Alice'))
5. Data Structures
• List: nums = [1, 2, 3]
• Tuple: coords = (10, 20)
• Set: unique = {1, 2, 3}
• Dict: person = {'name': 'Alice', 'age': 25}
6. File Handling
• with open('file.txt', 'r') as f: data = f.read()
• with open('file.txt', 'w') as f: f.write('Hello!')
7. Object-Oriented Programming
• class Person:
• def __init__(self, name):
• self.name = name
• def greet(self):
• return f'Hello, I am {self.name}'
8. Popular Libraries
• NumPy – Numerical computing
• Pandas – Data analysis
• Matplotlib – Visualization
• Requests – Web requests
9. Final Tips
• Practice coding daily
• Solve small projects
• Read documentation & join communities