This is a simple step-by-step Python learning hub for complete beginners. You start from zero and slowly become good at coding. We have 7 levels. Each level teaches one important topic with easy practice questions. Practice is the only way to learn coding well – do every question yourself. After the levels, try the 20 fun console projects to use everything you learned.
- Level 1: Python Basics - Variables & Input/Output
- Level 2: Working with Text - Strings
- Level 3: Making Decisions - Conditionals
- Level 4: Repeating Tasks - Loops
- Level 5: Organizing Data - Lists & Tuples
- Level 6: Advanced Collections - Sets & Dictionaries
- Level 7: Reusable Code - Functions
- 20 Console Projects
Why this level?
Learn how to store data in variables, take input from user, and print results. This is the first step of every Python program.
-
Swap Two Numbers
Define two numbers in variable. Swap them without extra variable. Print both after swap.Example: Input `First = 10` and `Second = 20` → Output: `First = 20`, `Second = 10`
-
Swap Two Strings
Take two strings from user. Swap them without extra variable. Print both after swap.Example: Input `First = "Ali"` and `Second = "Alia"` → Output: `First = "Alia"`, `Second = "Ali"`
-
Add Two Numbers
Ask user for two numbers. Add them and print the sum.Example: Input `5` and `8` → Output: `Sum = 13`
-
Area of Rectangle
Ask user for length and width. Calculate area and print it.Example: Input `4` and `6` → Output: `Area = 24`
-
Say Hello to User
Ask user for name. PrintHello [Name]!Example: Input `Ali` → Output: `Hello Ali!`
-
Full Name Greeting
Ask for first name and last name. Join them and print greeting.Example: Input `Alia` and `Mirza` → Output: `Hello, Alia Mirza!`
-
Welcome with Age
Ask for name and age. Print welcome message using f-string.Example: Input `Ali` and `20` → Output: `Welcome, Ali! You are 20 years old.`
Why this level?
Learn how to work with words and sentences. Almost every program needs text.
-
String Length Counter
Ask user for a sentence. Print how many characters it has.Example: Input `Hello Pakistan` → Output: `Length: 14`
-
Upper and Lower Case
Ask for a string. Print it in uppercase and lowercase.Example: Input `Python` → Output: `UPPER: PYTHON`, `lower: python`
-
Name Formatting
Ask first and last name. Print normal, uppercase, and title case.Example: Input `lilly`, `collins` → Output: `Normal: lilly collins`, `Title Case: Lilly Collins`
-
Formatted Bill
Ask item name, quantity, price. Print neat bill with total.Example: Input `Apple`, `5`, `50` → Output: `Item: Apple` `Quantity: 5` `Total: Rs.250`
Why this level?
Learn how to make your program choose different actions using if/elif/else.
-
Even or Odd
Ask a number. Print Even or Odd.Example: Input `7` → Output: `Odd`
-
Compare Two Numbers
Ask two numbers. Print which is bigger or if equal.Example: Input `10` `5` → Output: `10 is greater`
-
Pass or Fail
Ask marks. Print Pass (≥40) or Fail.Example: Input `35` → Output: `Fail`
-
Count Vowels
Ask for a word. Count vowels (a,e,i,o,u – ignore case).Example: Input `education` → Output: `Number of vowels: 5`
-
Positive, Negative, Zero
Ask a number. Print what it is.Example: Input `-4` → Output: `Negative`
-
Grade System
Ask percentage. Print A (≥80), B (60-79), C (40-59), Fail.Example: Input `85` → Output: `A Grade`
-
Simple Calculator
Ask two numbers and operation (+ - * /). Print result. Show error for divide by zero.Example: Input `10`, `5`, `/` → Output: `Result: 2.0`
Why this level?
Learn how to repeat work easily using while and for loops.
-
Print 1 to 10
Use for loop to print numbers 1 to 10. -
Multiplication Table
Ask a number. Print its table (1 to 10).Example: Input `5` → `5 x 1 = 5` ... `5 x 10 = 50`
-
Sum of Numbers
Ask a number n. Print sum from 1 to n.Example: Input `10` → Output: `Sum = 55`
-
Even Numbers 1-20
Print all even numbers from 1 to 20 using loop. -
Countdown
Print numbers from 10 down to 1 using while loop. -
Simple Star Pattern
Print this pattern using loops:* 1 * * 1 2 * * * 1 2 3 * * * * 1 2 3 4 * * * * * 1 2 3 4 5
Why this level?
Learn how to store many items in lists (can change) and tuples (cannot change).
-
Create Fruit List
Ask user for 5 fruits. Store in list and print. -
Access List Items
Make list [10,20,30,40,50]. Print first, middle, last. -
Add and Insert Items
Start empty list. Append 3 items. Insert one at position 1. Print final list. -
List Slicing
Make list 1 to 10. Print first 5, last 3, and items 3 to 8. -
Introduction to Tuples
Make tuple of 5 days. Print it and try to change one item (will give error). -
Convert List to Tuple
Ask 4 subjects → store in list → convert to tuple → print both.
Why this level?
Learn sets (unique items) and dictionaries (key-value pairs).
-
Create and Add to Set
Make empty set. Add 5 numbers. Print set (duplicates removed). -
Set Operations
Make two sets. Print union and intersection. -
Remove from Set
Make set with 6 items. Remove one and discard one (if not exist). Print after each. -
Student Marks Dictionary
Make dict with 3 student names and marks. Print all. -
Add and Update Dict
Start empty dict. Add 3 key-value pairs. Update one value. -
Word Frequency
Ask a sentence. Make dict to count how many times each word appears.
Why this level?
Learn how to make functions so you can use same code again easily.
-
Add Two Numbers Function
Make function add(a, b) that returns sum. Call it and print. -
Check Even/Odd Function
Make function is_even(num) that returns True or False. Use it. -
Maximum of Three
Make function max_of_three(a,b,c) that returns biggest number. -
Factorial Function
Make function factorial(n) using loop. Return n!. -
Greeting Function
Make function greet(name, age) that prints welcome message. -
Area Calculator Function
Make function area(shape, values) that calculates rectangle or triangle area.
-
Scientific Calculator
Make a menu-based calculator with many math operations.
Useimport mathfor advanced functions.
Create separate functions for each operation in a file calledoperations.py.
Main filemain.pyshows menu and calls functions.Features:
- Addition, Subtraction, Multiplication, Division
- Square, Cube, Custom Power (like x^y)
- Square Root, Cube Root
- Sin, Cos, Tan (and inverse: asin, acos, atan)
- Log (base 10), Natural Log (ln), Antilog
- Handle errors (like divide by zero)
Small Challenge: Add memory – user can store last result and use it again (M+ button style).
-
Number Guessing Game
Computer picks a random number. User guesses with hints.
Useimport randomandimport time.Features:
- User chooses how many rounds to play
- Each round the range increases (Round 1: 1-50, Round 2: 1-100, etc.)
- Time limit: starts 30 seconds, every next round subtract 5 seconds
- Show "Too high" or "Too low" hints
- Count total score
Small Challenge: Save high score with player name (use a text file if you want extra practice).
-
Quiz Game
Ask multiple-choice questions. Count score at the end.Features:
- At least 10 questions stored in a list of dictionaries
- Questions come in random order every time
- 4 options for each question
- Timer: 15 seconds per question
- Show final score and correct answers
Small Challenge: Add different categories (like General Knowledge, Python, Pakistan History) – user chooses category first.
-
To-Do List
Simple task manager.Features:
- Add task
- View all tasks with numbers
- Mark task as completed
- Delete task
- Save tasks when program ends (use a text file – optional but good practice)
Small Challenge: Add due date for each task and show warning if today’s date is past due.
-
Password Generator
Create strong random passwords.Features:
- Ask length and what to include (uppercase, lowercase, numbers, symbols)
- Generate password
- Option to generate many at once
- Check password strength (simple count of character types)
Small Challenge: Add option to exclude similar characters (like l and 1, O and 0).
-
BMI Calculator
Calculate Body Mass Index and give health advice.Features:
- Ask weight (kg) and height (cm or meters)
- Calculate BMI = weight / (height in m)²
- Show category: Underweight, Normal, Overweight, Obese
- Explain what BMI means in simple words
Small Challenge: Add ideal weight suggestion based on height.
-
Hangman Game
Classic word guessing game.Features:
- Random word from a list
- Show dashes for letters
- 6 wrong guesses allowed (draw simple hangman with print)
- Accept only single letters
Small Challenge: Add categories (fruits, animals, countries) – user chooses first.
-
Tic-Tac-Toe (Player vs Computer)
Play against computer.Features:
- 3x3 board shown with numbers
- Player is X, computer is O
- Computer makes random valid move
- Check for win or draw after each turn
Small Challenge: Make computer smarter – block player if they are about to win.
-
Contact Book
Store and manage contacts.Features:
- Add contact (name, phone, email)
- Search by name
- View all contacts
- Delete contact
- Save to file (optional)
Small Challenge: Add edit contact option.
-
Simple Banking System
Basic bank account simulator.Features:
- Create account with name and starting balance
- Deposit money
- Withdraw (check if enough balance)
- View balance and transaction history
- Simple PIN protection (ask PIN at start)
Small Challenge: Add interest calculation every "month" (when user presses option).
-
Simple Encryption Tool
Encrypt and decrypt messages using Caesar cipher.
Create two files:crypto.py(functions) andmain.py(menu).Features:
- Menu: Encrypt, Decrypt, Exit
- Ask message and salt (shift number 1-25)
You must create these two functions in
crypto.py:def encrypt(message: str, salt: int) -> str: # Shift each letter forward by salt (a → d if salt=3) # Keep case, ignore non-letters def decrypt(message: str, salt: int) -> str: # Shift backward
Small Challenge: Add option to try all 25 shifts to break unknown cipher (brute force).
-
Countdown Timer
Timer that counts down and beeps at end.Features:
- Ask minutes and seconds
- Show time left updating every second
- Print "Time's up!" at end
- Use
time.sleep(1)
Small Challenge: Add pause and resume with key press.
-
Simple Chatbot
Bot that replies to user messages.Features:
- Greet user
- Reply to common questions (how are you, what is your name, time, date, etc.)
- Funny replies for unknown messages
- Exit command
Small Challenge: Remember user name after first ask and use it in replies.
-
Student Grade System
Manage student records and marks.Features:
- Add student (name, roll no, marks in 5 subjects)
- View all students with percentage and grade
- Search student by roll no
- Show class average and highest scorer
Small Challenge: Save data to file so it remains after program closes.
