| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
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.
Purpose
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. Print Hello [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.`Purpose
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`Purpose
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`Purpose
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 5Purpose
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.
Purpose
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.
Purpose
Learn the basics of OOP. Create your own classes, objects, and attributes. This is the foundation of modern programming.
Create a Simple Class
Define a class named Dog with no attributes or methods. Create an object called my_dog. Print the type of my_dog.
Example: print(type(my_dog)) → Output: <class '__main__.Dog'>Add Attributes to Object
Using the same Dog class, create my_dog and add two attributes: name = "Buddy" and age = 5. Print both attributes.
Example: print(my_dog.name) and print(my_dog.age) → Output: Buddy 5Multiple Objects
Create two objects of Dog class: dog1 and dog2. Give different name and age to each. Print names of both.
Class Attribute
Add a class attribute species = "Canine" to Dog class (outside init). Create any object and print dog.species. It should work for all objects.
Modify Attribute
Create a class Car. Create car1 object. Add color = "Blue". Print color, then change it to "Red" and print again.
Empty Class with Pass
Create a class Student using pass keyword. Create object, add name and roll_no attributes manually. Print both.
Purpose
Learn how to use init constructor and define methods inside classes. Make your objects more powerful.
Constructor with init
Create a class Person with init(self, name, age). Create object p1 and print name and age.
Example: p1 = Person("Ali", 25)print(p1.name) → Output: Ali
Method Inside Class
In Person class, add a method greet(self) that prints "Hello, my name is [name]". Call the method on p1.
Method with Parameters
Add a method birthday(self) in Person that increases age by 1. Call it and print new age.
Multiple Methods
Create a class Calculator with init and two methods: add(self, a, b) and multiply(self, a, b). Create object and call both.
String Representation
In Dog class (from previous), add str(self) method that returns "Dog named [name], age [age]". Print the object.
Bank Account Example
Create class BankAccount with init(self, balance=0), deposit(self, amount) and withdraw(self, amount). Test deposit and withdraw.
Purpose
Learn inheritance, method overriding, and basic polymorphism. Reuse code like a pro.
Simple Inheritance
Create class Animal with eat(self) method. Create class Dog(Animal). Create dog object and call eat().
Method Overriding
In Dog class, override eat(self) to print "Dog is eating bones". Create dog object and call eat().
Using super()
Add init in Animal (name). In Dog use super() to set name. Add bark(self) method. Test both.
Multiple Child Classes
Create Cat(Animal) and Dog(Animal). Give each their own sound method. Create objects and call sound().
Polymorphism Example
Create a function make_sound(animal) that calls animal.sound(). Pass Dog and Cat objects to it.
Real World Example
Create class Vehicle with move(self). Create Car(Vehicle) and Bike(Vehicle) with different move messages. Test both.
Skills: variables, loops, conditionals, random, input validation, functions.
Skills: functions, exception handling, parsing strings, loops.
Skills: lists, file I/O (text or JSON), CRUD operations, functions.
Skills: dictionaries, lists, file I/O, simple validation, search.
Skills: strings, concatenation, user input, functions, lists.
Skills: random, loops, counters, basic plotting (optional), statistics.
Skills: lists/dicts, file I/O (CSV/JSON), aggregation, date handling (optional).
Skills: JSON, loops, input validation, scoring, functions.
Skills: loops, conditionals, modulo arithmetic, nested loops for patterns.
Skills: file I/O, string processing, dicts, sorting.
Skills: functions, state management, optional classes, input validation.
Skills: inheritance, polymorphism, methods, math module.
Skills: classes, inheritance, polymorphism, dictionaries.
Skills: classes, inheritance, polymorphism, lists, JSON.
Skills: classes, composition, polymorphism, input validation.
Skills: models, templates, forms, authentication, static/media files, admin customization.
Skills: models, forms, email, authentication, date fields, permissions.
Skills: models, forms, authentication, pagination, filtering, file upload.
Skills: models, ManyToMany, forms, authentication, ratings, image upload.
Skills: models, forms, authentication, file upload, search, messages/notifications.
| Back | FazBrowse Home | New Git URL |