πŸš€ 7-Day Python Refresh Plan πŸš€

From Scratch to Proficiency – Your Daily Guide to Mastering Python

Welcome to your structured 7-day plan to refresh your Python skills from scratch! Each day focuses on key topics, providing hands-on examples and valuable free resources to guide your learning journey. Let's dive in!

Day 1: Python Basics & Syntax

Topics:

Hands-on Example:

# Calculate area of a circle
radius = float(input("Enter radius: "))
area = 3.14 * radius ** 2
print(f"Area of the circle: {area:.2f}")

Free Resources:

Day 2: Control Flow & Loops

Topics:

Hands-on Example:

# Check if a number is prime
num = int(input("Enter a number: "))
is_prime = True
for i in range(2, int(num ** 0.5) + 1):
    if num % i == 0:
        is_prime = False
        break
print(f"{num} is {'prime' if is_prime else 'not prime'}.")

Free Resources:

Day 3: Functions & Modules

Topics:

Hands-on Example:

# Generate a random password
import random
import string

def generate_password(length=8):
    chars = string.ascii_letters + string.digits + "!@#$%"
    return ''.join(random.choice(chars) for _ in range(length))

print("Your password:", generate_password(10))

Free Resources:

Day 4: Data Structures

Topics:

Hands-on Example:

# Count word frequency in a sentence
sentence = "hello world hello python world"
words = sentence.split()
frequency = {}

for word in words:
    frequency[word] = frequency.get(word, 0) + 1

print(frequency)

Free Resources:

Day 5: File Handling & Error Handling

Topics:

Hands-on Example:

# Read a file and handle exceptions
try:
    with open("sample.txt", "r") as file:
        content = file.read()
    print(content)
except FileNotFoundError:
    print("File not found!")

Free Resources:

Day 6: Object-Oriented Programming (OOP)

Topics:

Hands-on Example:

# A simple BankAccount class
class BankAccount:
    def __init__(self, balance=0):
        self.balance = balance
    
    def deposit(self, amount):
        self.balance += amount
    
    def withdraw(self, amount):
        if amount <= self.balance:
            self.balance -= amount
        else:
            print("Insufficient funds!")

account = BankAccount(100)
account.deposit(50)
account.withdraw(30)
print(f"Balance: ${account.balance}")

Free Resources:

Day 7: Mini Project (Consolidation Day)

Apply what you learned in a small project:

Example (To-Do List):

tasks = []

while True:
    print("\n1. Add Task\n2. View Tasks\n3. Exit")
    choice = input("Choose an option: ")
    
    if choice == "1":
        task = input("Enter task: ")
        tasks.append(task)
    elif choice == "2":
        print("\nTasks:")
        for idx, task in enumerate(tasks, 1):
            print(f"{idx}. {task}")
    elif choice == "3":
        break
    else:
        print("Invalid choice!")

Free Resources:

🌟 Bonus Tips 🌟

Happy coding and enjoy your Python journey! 🐍