Python
Python in 10 Days
Hands-on Python roadmap — one project a day.
🐍 Learn Python in 10 Days – Hands-On Roadmap
Learn Python by building small, real projects every day. No fluff. No long lectures. Just code and confidence.
Python Sample exercize
Link to list of python beginner level exercize
📅 Day 1: Hello Python & Setup
{: #day-1-hello-python-setup }{: #day-1-hello-python-setup }
🔍 What You’ll Learn
-
Install Python
-
Run your first
.pyfile -
Print text and numbers
-
Variables and data types
🛠️ Let’s Do It
print("Hello, Python!")
name = input("What’s your name? ")
age = int(input("How old are you? "))
print(f"{name}, you’ll be {age+1} next year!")
🎯 Task
-
Create a file named
hello.py -
Ask the user’s name and age
-
Greet them with a message using
f-string
📅 Day 2: Conditions & Loops
🔍 What You’ll Learn
-
if,elif,else -
for,whileloops -
breakandcontinue
🛠️ Let’s Do It
num = int(input("Guess a number: "))
if num == 7:
print("Correct!")
else:
print("Try again!")
# Count 1 to 5 using loop
for i in range(1, 6):
print(i)
🎯 Task
-
Build a number guessing game (max 3 tries)
-
Add a secret number with a hint
📅 Day 3: Functions & Reuse
🔍 What You’ll Learn
-
def, parameters, return -
Reusable code blocks
🛠️ Let’s Do It
def greet(name):
return f"Hello, {name}!"
print(greet("Alice"))
🎯 Task
-
Write a function that adds 2 numbers
-
Write a function that checks if a number is even
📅 Day 4: Strings & Input Formatting
🔍 What You’ll Learn
-
String methods:
.lower(),.upper(),.replace() -
Slicing and indexing
🛠️ Let’s Do It
msg = "Learn Python"
print(msg.upper())
print(msg[0:5]) # 'Learn'
🎯 Task
-
Create a sentence reverser
-
Input: “Python is fun” → Output: “fun is Python”
📅 Day 5: Lists & Loops
🔍 What You’ll Learn
-
Creating and accessing lists
-
append(),pop(), slicing
🛠️ Let’s Do It</
Add
fruits = ["apple", "banana", "cherry"]
fruits.append("kiwi")
print(fruits)
Insert at specified index
fruits = ["apple", "banana", "cherry"]
#this insert kiwi in the begining
fruits.insert("kiwi",0)
print(fruits)
Remove
fruits = ["apple", "banana", "cherry"]
fruits.remove("apple")
print(fruits)
Loop list
fruits = ["apple", "banana", "cherry"]
for fruit in fruits:
print(fruit)
🎯 Task
-
Make a to-do list program
-
Allow user to add, view, remove tasks
📅 Day 6: Dictionaries – Key to Python
🔍 What You’ll Learn
-
Dictionary creation & access
-
Loops with dicts
🛠️ Let’s Do It
person = {"name": "Bob", "age": 25}
print(person["name"])
Add to python dictionary
person = {"name": "Bob", "age": 25}
## Added key profession and value engineer
{: #added-key-profession-and-value-engineer }
person["profession"]="engineer"
print(person)
Remove
person = {"name": "Bob", "age": 25}
# this will remove any key randomly and value.
person.popitem()
print(person)
Update value of key
Frequency Map in Python
A frequency map (or frequency dictionary) is a way to count how many times each element appears in a collection (like a string, list, etc.).
It uses a dictionary (dict) where:
- Key = element (e.g., character)
- Value = count (frequency)