### Python 45-Day Learning Plan with Explanations and Code Examples
#### Days 121: Python Basics
(Refer to earlier content: variables, operators, loops, functions, lists, tuples, dictionaries, sets)
#### Day 22: Introduction to OOP
OOP (Object-Oriented Programming) helps structure programs using classes and objects.
```python
class Dog:
def __init__(self, name):
[Link] = name
def speak(self):
print(f"{[Link]} says Woof!")
my_dog = Dog("Buddy")
my_dog.speak()
```
#### Day 23: Class vs Instance Attributes
Class attribute is shared; instance attribute is unique.
```python
class Car:
wheels = 4
def __init__(self, brand):
[Link] = brand
car1 = Car("Toyota")
print([Link], [Link])
```
#### Day 24: Inheritance
```python
class Animal:
def speak(self):
print("Animal speaks")
class Cat(Animal):
def speak(self):
print("Meow")
Cat().speak()
```
#### Day 25: super()
```python
class A:
def show(self):
print("A")
class B(A):
def show(self):
super().show()
print("B")
B().show()
```
#### Day 26: Encapsulation
```python
class BankAccount:
def __init__(self, balance):
self.__balance = balance
def get_balance(self):
return self.__balance
```
#### Day 27: Polymorphism
```python
class Bird:
def fly(self):
print("Bird flies")
class Plane:
def fly(self):
print("Plane flies")
def lift_off(obj):
[Link]()
lift_off(Bird())
```
#### Day 28: OOP Mini Project
```python
class Student:
def __init__(self, name, grade):
[Link] = name
[Link] = grade
def display(self):
print(f"{[Link]}: {[Link]}")
```
#### Day 2931: File I/O & Exceptions
```python
with open("[Link]", "r") as f:
print([Link]())
try:
x = int(input("Enter: "))
print(10 / x)
except:
print("Error")
```
#### Day 3234: Modules & Custom Modules
```python
import math
print([Link](16))
# [Link]
def add(a, b): return a + b
```
#### Day 3536: pip & requests
```bash
pip install requests
```
```python
import requests
print([Link]("[Link]
```
#### Day 3740: datetime, json, generators
```python
from datetime import datetime
print([Link]())
def gen():
yield from range(3)
```
#### Day 41: lambda, map, filter
```python
nums = [1, 2, 3]
print(list(map(lambda x: x * 2, nums)))
```
#### Day 42: Decorators
```python
def deco(func):
def wrap():
print("Start")
func()
print("End")
return wrap
@deco
def hello():
print("Hello")
hello()
```
#### Days 4345: Final Projects
- Contact Manager
- Quiz App
- Expense Tracker
Congrats! You're ready to build Python apps.