Python Learning Guide
1. Introduction to Python
- Python is a high-level, interpreted programming language.
- It is popular for web development, data science, AI, and automation.
2. Python Basics
- Variables: x = 10, name = 'Harsh'
- Data Types: int, float, str, list, dict, tuple, set
- Print: print('Hello World')
3. Control Structures
- If-Else: if x > 0: print('Positive') else: print('Negative')
- Loops: for i in range(5): print(i), while x < 5: x += 1
4. Functions
- Functions help reuse code.
- Example: def greet(name): return f'Hello {name}'
5. Lists & Dictionaries
- List: numbers = [1,2,3]
- Dictionary: student = {'name':'Harsh','age':20}
6. Object-Oriented Python
- class Car: def __init__(self, brand): self.brand = brand
- my_car = Car('Tesla')
7. File Handling
- with open('file.txt','r') as f: data = f.read()
- with open('file.txt','w') as f: f.write('Hello')
8. Libraries
- Popular Libraries: numpy, pandas, matplotlib, flask, django
9. Projects Ideas
- Calculator app
- To-do list
- Weather app using API
- Simple game (Tic-Tac-Toe)
10. Conclusion
- Start small, practice daily, and build projects!