This repository contains beginner to intermediate Python tasks designed to help learners understand Object-Oriented Programming (OOP) concepts such as:
- ✅ Creating and using classes
- ✅ Defining attributes and methods
- ✅ Using constructors (
__init__) - ✅ Working with objects (instances)
- ✅ Encapsulation (storing and managing data inside objects)
Each task is designed to be real-life relatable so learners can understand why and how OOP is useful in solving practical problems.
- Voting System
- Attendance Register
- Bank Account Simulation
- Library Management System
- Student Grading System
- Simple Calculator (OOP Version)
- To-Do List Manager
- Inventory Management
- Restaurant Ordering System
- Hospital Patient Management
- Course Registration System
- Employee Payroll System
- Movie Ticket Booking
- E-commerce Shopping Cart
Create a VotingSystem class that allows:
- Registering candidates
- Casting votes
- Displaying results
🔑 Concepts: Class attributes, updating dictionaries, method calls.
Create an AttendanceRegister class that allows:
- Adding students
- Marking attendance (Present/Absent)
- Displaying attendance records
🔑 Concepts: Class methods, lists/dictionaries as attributes.
Create a BankAccount class that allows:
- Depositing money
- Withdrawing money
- Checking balance
🔑 Concepts: Encapsulation, state management, error handling.
Create a Library class that allows:
- Adding books
- Borrowing books
- Returning books
- Displaying available books
🔑 Concepts: Object collection, updates, validation.
Create a GradingSystem class that allows:
- Recording student grades
- Calculating averages
- Determining letter grades (A, B, C, etc.)
🔑 Concepts: Dictionaries, conditionals inside methods.
Create a Calculator class that allows:
- Addition, subtraction, multiplication, division
- Handling invalid inputs (like division by zero)
🔑 Concepts: Methods for mathematical operations, input validation.
Create a TodoList class that allows:
- Adding tasks
- Updating tasks (completed/pending)
- Viewing all tasks
🔑 Concepts: Lists as storage, methods to manage status.
Create an Inventory class that allows:
- Adding items with quantity
- Updating stock when items are sold
- Displaying current stock
🔑 Concepts: Class attributes, dictionaries, real-world simulation.
Create an OrderSystem class that allows:
- Adding menu items
- Taking customer orders
- Displaying total bill
🔑 Concepts: Object storage, iteration, basic arithmetic.
Create a Hospital class that allows:
- Adding patients
- Assigning doctors
- Displaying patient records
🔑 Concepts: Nested data structures, OOP relationships.
Create a CourseRegistration class that allows:
- Adding courses
- Enrolling students in courses
- Displaying enrolled students
🔑 Concepts: Lists/dictionaries, multiple object tracking.
Create a PayrollSystem class that allows:
- Adding employees with salaries
- Calculating total payroll
- Giving salary raises
🔑 Concepts: Arithmetic in methods, managing multiple objects.
Create a TicketBooking class that allows:
- Displaying available seats
- Booking tickets
- Canceling tickets
🔑 Concepts: Updating lists/dictionaries, validations.
Create a ShoppingCart class that allows:
- Adding products to cart
- Removing products
- Checking out (total price)
🔑 Concepts: Real-world application of OOP, aggregation.
- Clone or download this repo.
- Open the
.pyfiles for each task. - Run them in your terminal or IDE.
- Try extending each class by adding more features.
By completing these tasks, you will:
-
Understand the basics of OOP in Python
-
Learn to design real-world applications using classes
-
Transition easily into more advanced OOP concepts like:
- Inheritance
- Polymorphism
- Abstraction