Day - 15 ( kumarcodes_ )
What is Unicode?
Unicode is a global standard that gives every character (letters,
digits, symbols, emojis) a unique number called a code point.
Think of it as a character’s ID card that computers use to store,
compare, and process text.
Unicode values :
Example:
'A' → Unicode 65
'a' → Unicode 97
'0' → Unicode 48
What is ord()?
ord()→ Takes a character and returns its Unicode value
(integer).
Think of it as: character → number.
Code :
What is chr()?
chr()→ Takes a Unicode value (integer) and returns the
character.
Think of it as: number → character.
Code :
Comparing Strings using Unicode :
Python compares strings character-by-character using
Unicode values.
Example :
Even Telugu Alphabets have Unicode Values :
Printing name in Telugu using unicode values
Telugu Alphabets unicode ranges(3072 to 3199)
Code :
Output :
Real-life Examples of Unicode Usage :
Multi-language apps – Unicode allows apps like WhatsApp or
Instagram to support all languages (English, Telugu, Hindi,
Japanese, etc.).
Emoji handling – Every emoji you send has a unique Unicode
code point.
Sorting names in a database – Computers sort text
alphabetically based on Unicode values.
Password checks – Systems compare Unicode values to match
typed and stored characters.
Search engines – Matching your typed query with stored text
uses Unicode comparison.
Day - 16
What are Data Structures?
Data Structures are ways to store and organize data so we can
use it efficiently.
In Python, there are 4 inbuilt data structures:
List→ Ordered, changeable collection
Tuple → Ordered, unchangeable collection
Set → Unordered, unique elements
Dictionary →Key–value pairs
What is a List?
A list in Python is an ordered collection that can store multiple
items in a single variable.
It can hold different data types — integers, strings, floats, even
other lists.
Lists are mutable, meaning you can change their contents after
creation.
Example :
Output :
Real-life Examples of Lists :
📅 To-do list - store daily tasks
🛒 Shopping cart - store items selected by a user
🎵 Playlist - store songs in order
🧾 Attendance list - store student names
🛫 Travel itinerary - store trip stops in sequence
Day - 17 ( kumarcodes_ )
Tuples in Python :
A tuple is an ordered collection of items.
Can store different data types.
Immutable → once created, you can’t change, add, or
remove items.
Created using round brackets ( ).
Code :
Output :
Real-life uses of Tuples :
1. GPS coordinates → (17.3850, 78.4867)
2. RGB colors in graphics → (255, 0, 0) for red
3. Date and time storage → (2025, 8, 13)
List vs Tuple in Python :
Practice Questions on Lists & Tuples
Lists :
1. Create a list of 5 fruits and print the first and last fruit.
2. Make a list of 5 numbers and find the sum of all numbers
using sum().
3. Create a list with your 5 favorite movies, then add one
more movie to the list.
[Link] an item from a shopping list (["Milk", "Bread",
"Butter"]).
5. Concatenate two lists: ["Red", "Blue"] and ["Green",
"Yellow"].
Tuples :
1. Create a tuple of 3 colors and print each color using
indexing.
2. Store your (Name, Age, Height) in a tuple and print it.
3. Create a tuple of numbers (10, 20, 30, 40) and find the
maximum and minimum.
4. Try to change a value inside a tuple and observe the
error → explain why it happens.
5. Convert a list of numbers [1, 2, 3, 4] into a tuple using
tuple().
Sets in Python :
A set is an unordered collection of unique items.
No duplicates allowed.
Created using curly braces { } or the set() function.
Useful when you want only unique values.
When you print a set, Python may rearrange the items for
faster internal storage and searching.
Printing a set (order not guaranteed)
Types of Set Operations
Python supports different operations on sets (just like math sets):
Real-life Examples of Sets :
1. 📱 Contact list in your phone → no duplicate phone
numbers allowed.
2. 🌐 Unique website visitors → count each visitor only once.
3. 🎶 Playlist of songs → automatically avoid duplicate songs.
4. 🛒 Shopping cart → keeps each product listed once.
Day - 19
What is a Dictionary in Python?
A dictionary is used to store data in the form of key–value pairs.
Keys are unique, and each key maps to a specific value.
Written using curly braces { }.
→
Think of it like a real-life dictionary a word (key) has a meaning
(value).
Real-life Examples of Dictionaries :
1. 📱 Phonebook → {"Amit": 98765, "Ravi": 87654}
2. 🛒 Shopping cart → {"Oil": 1, "Soap": 4, "Sugar": 2}
3. 🏫 Report card → {"Math": 90, "Science": 95, "English": 85}
Dictionary Operations :
Sets vs Dictionaries in Python :
Set → only values, unique, no duplicates.
Dictionary → key–value pairs, useful for storing related data.
Practice Questions on Sets
[Link] a set of 5 fruits and print it.
[Link] a new fruit "mango" to the set.
[Link] "apple" from a set of fruits.
[Link] two sets: {1, 2, 3} and {3, 4, 5}, and find their
union.
[Link] the intersection of {10, 20, 30} and {20, 30, 40}.
Practice Questions on Dictionaries
[Link] a dictionary for a student with keys → name,
age, grade. Print it.
[Link] a new key "course": "Python" to the dictionary.
[Link] the "age" of the student to 21.
[Link] "grade" from the dictionary.
[Link] a dictionary of 3 countries and their capitals, then
print the capital of "India".
Day - 20
What are Functions in Python?
A function is a block of reusable code.
Instead of writing the same code again and again, we put
it inside a function and just call it whenever needed.
Functions make code clean, simple, and reusable.
Real-life Example of a Function :
Imagine your washing machine 🧺:
You press the Start button → (calling the function).
Inside, it does washing, rinsing, drying → (function code).
After it’s done, you get clean clothes → (function output).
👉 Just like this, in Python, a function is a machine that takes
input, does some work, and gives output.
Syntax of a Function in Python :
def → keyword to define a function
function_name → the name you give the function
parameters → input values (optional)
return → sends back a value (optional)
Simple Function :
Function with Operations :
Function without parameters :
Student takeaway:
Functions help reuse code.
They can take input, perform tasks, and give output.
They make programs clean and efficient.
Practice Questions on Functions
1. Write a function greet() that prints "Welcome to Python!" (no
parameters).
2. Write a function add(a, b) that takes two numbers and returns
their sum.
3. Write a function square(num) that returns the square of a
number.
4. Write a function is_even(num) that checks if a number is even
or odd and prints the result.
5. Write a function multiply_three(a, b, c) that multiplies three
numbers and returns the result.
Day - 21
Function Arguments :
Arguments are the values you pass into a function when
calling it.
They act like inputs that the function uses to do its job.
🍳→
Think of it like giving ingredients to a chef the chef
(function) cooks something using those ingredients
(arguments).
Real-life Example of Function Arguments :
Imagine ordering pizza :🍕
You say: “I want a large pizza with cheese and mushrooms.”
Here:
Function = order_pizza(size, toppings)
Arguments = large, cheese, mushrooms
The function (chef) prepares your pizza using the given
arguments.
Syntax :
1️⃣ def → tells Python you are creating a function.
2️⃣ function_name → the name you give the function.
3️⃣ (arguments) → inputs the function needs.
4️⃣ Function body → the code that runs inside
(can return a result).
5️⃣ function_name(values) → how you call the function
with real values.
Code :
Output :
Student Takeaway:
Arguments = inputs to a function.
Functions use them to work with different values without
rewriting code.
They make functions flexible and reusable.
Types of Function Arguments in Python :
Positional Arguments
Keyword Arguments
Default Arguments
Arbitrary Arguments (*args)
Arbitrary Keyword Arguments (**kwargs)
Types of Function Arguments in Python :
1️⃣ Positional Arguments :
Values are passed in order.
Position matters.
Code :
2️⃣ Keyword Arguments :
Values are passed using parameter names.
Order does not matter.
Code :
3️⃣ Default Arguments
If no value is given, the function uses the
default value.
Code :
4️⃣ Arbitrary Arguments (*args) :
Allows passing any number of values
(collected as a tuple).
Code :
5️⃣ Arbitrary Keyword Arguments (**kwargs) :
Allows passing any number of key–value pairs
(collected as a dictionary).
Code :
Real-life Analogy :
Positional→ Filling form in order
(First Name, Last Name, Age).
Keyword → Food order with labels
(size = Large, item = Pizza).
Default → ATM defaults to English if you don’t choose
language.
*args → Shopping cart with unlimited items.
**kwargs → Profile form where you can add details
(name, age, email, etc.).
Day - 22
What is Recursion?
Recursion is when a function calls itself.
Useful for problems that can be broken into smaller, similar
problems.
Real-life Example:
Standing in front of two mirrors 🔁 - your reflection keeps
repeating inside each mirror.
Or: A Russian Matryoshka doll 🪆 → each doll contains a
smaller version of itself.
Code :
Output :
15
Execution (Step by Step):
sum(5) →
5 + sum(4)
sum(4) →
4 + sum(3)
sum(3) →
3 + sum(2)
sum(2) →
2 + sum(1)
sum(1) →
1 (stop)
Now add back: 5 + 4 + 3 + 2 + 1 = 15.
Student Takeaway:
Recursion = big problem broken into smaller ones, solved step by
step until reaching the simplest case.
Real-life Analogy: Staircase Climbing 🪜
Imagine you want to count the total steps in a staircase.
You stand on step n, then say: “This step + the steps below.”
You keep asking the next lower step to count, until you reach
step 1.
→
Step 1 says: “I’m the last step” that’s the base case.
Then, all steps add up to give the total count.
This is exactly how recursion works: each step depends on the
smaller one until the base is reached.
Day - 23
What are Built-in Functions?
Python already provides some ready-made functions →
you don’t need to create them.
Just call them and use them directly.
Examples of Built-in Functions :
→
1. len() 🛒
count items in the list (like items in a cart )
→
2. sorted() arrange marks in order (like ranking students by
🏫
marks )
3. sum()→ total of all marks (like total monthly expenses )💰
4. max() and min() → highest & lowest marks (like top and lowest
📊
score )
→
5. round() round average marks to 2 decimals (like rounding
💵
prices )
6. reversed() → reverse the list order (like looking at data from
back side)
Code :
Output :
Takeaway:
Built-in functions = ready-made tools given by Python.
Saves time — you don’t need to write extra code.
Day - 24
Python Project: Expense Tracker
Let’s build a Simple Expense Tracker - step by step, super
clear, and student-friendly. This will be a great Day 24/25
project to end your series with impact.
Code :
Output :
Expense Tracker - Step-by-Step (No Code)
1. Start
Greet the user and explain: “Enter expenses one by
one. Type ‘done’ to finish.”
2. Create a place to store amounts
Think of an empty bucket called Expenses where we’ll
drop each amount.
3. Ask for an expense name
Prompt: “Enter expense (or ‘done’)”
4. Check for stop word
If the user types done (any case), stop collecting
and go to the report.
Otherwise, continue.
5. Ask for the amount
Prompt: “Enter amount for that item (₹)”
Accept decimals (like ₹30.5).
[Link] the amount
Put the number into the Expenses bucket.
7. Repeat
Go back to step 3 and keep collecting until the user
types done.
8. Generate the report
Show:
All expenses (the list of numbers entered)
Total spent = add all numbers
Highest expense = largest number
Lowest expense = smallest number
Average expense = total ÷ number of entries
(rounded to 2 decimals)
9. Display neatly
Print each result with the ₹ symbol and clear labels.
10. End
Thank the user or invite them to track again tomorrow.
Day - 25
Simple To-Do List Program :
What the program is
A tiny To-Do List app that lets you:
add a task
view all tasks (numbered)
quit the app
All tasks are kept in one list called tasks.
Code :
Takeaway :
List stores tasks.
Loop keeps the app interactive.
Add = append, View = loop + manual numbering,
Quit = break.
Output :
How it runs (step by step)
1. Start + setup
Program prints “Welcome to To-Do List!”.
Makes an empty list: tasks = [].
2. Enter the main loop
while True: keeps asking what you want to do until you quit.
3. Ask for an action
It shows: Choose: add / view / quit:
Whatever you type is converted to lowercase with .lower() so ADD, Add, add
all work.
4. If you type add
It asks: Enter a task:
You type something (e.g., “Complete college assignments”).
That text is appended to the list: [Link](task).
Prints “Task added!”
Loop repeats and asks again.
5. If you type view
It prints a header: “Your To-Do List:”
Sets index = 1.
Goes through each task in tasks and prints
index - task, then increases index by 1.
(This is why your output shows 1 - …, 2 - …, 3 - ….)
6. If you type quit
→
Prints “Goodbye!” and uses break to exit the loop program ends.
7. If you type anything else
Prints “Invalid option” and asks again.