Welcome to my Python programs repository! Below are the Python scripts available in this repository, covering a range of topics from basic algorithms to object-oriented programming.
- Write a Python program to create a person class. Include attributes like name, country and date of birth. Implement a method to determine the person's age. - Calculating age based on birth year.
- Write a Python program to create a class representing a stack data structure. Include methods for pushing and popping elements. - Implementing a stack data structure.
- Write a Python program to create a class representing a shopping cart. Include methods for adding and removing items, and calculating the total price. - Simple shopping cart implementation.
- Write a Python program to create a class representing a bank. Include methods for managing customer accounts and transactions. - Creating classes to model a bank account system.
- Create a Bus child class that inherits from the Vehicle class. The default fare charge of any vehicle is seating capacity * 100. If Vehicle is Bus instance, we need to add an extra 10% on full fare as a maintenance charge. So total fare for bus instance will become the final amount = total fare + 10% of the total fare. - Defining a class for managing bus operations.
- Define a class attribute “color” with a default value white. i.e., Every Vehicle should be white. - Adding color attribute to vehicle class.
- Implement a class inheritance as following - Understanding inheritance in Python classes.
- Create a Python class called “Car” with attributes like make, model, and year. Then, create an object of the “Car” class and print its details. - Building a class to represent a car with specific attributes and methods.
- Create a base class called “Animal” and two subclasses, “Dog” and “Cat.” Add methods and attributes specific to each subclass. - Implementing classes to model different animals.
- Create three classes, “Person,” “Employee,” and “Student.” Use multiple inheritance to create a class “PersonInfo” that inherits from both “Employee” and “Student.” Add attributes and methods specific to each class. - Implementing a class to represent a person with attributes and methods.
- Create a base class called “Vehicle” with a method called “drive.” Implement two subclasses, “Car” and “Bicycle,” that inherit from “Vehicle” and override the “drive” method with their own implementations. - Defining methods for a vehicle class to perform actions like starting and stopping.
- Define a class with a generator which can iterate the numbers, which are divisible by 7, between a given range 0 and n. - Finding numbers divisible by 7 within a given range.
- Write a program to compute the frequency of the words from the input. The output should output after sorting the key alphanumerically. - Sorting a list of alphanumeric strings.
- To find the Euclidean distance between two points in a two dimensional space using class and object - Calculating the Euclidean distance between two points in 2D space.
- Create a Python program for an online quiz system. Implement classes for quizzes, questions, and users. Include methods for taking quizzes, scoring, and displaying results. - Implementation of an online quiz program.
- Build a hotel reservation system with classes for rooms, guests, and reservations. Implement methods for checking room availability, booking rooms, and generating invoices. - Managing hotel room reservations.
- Develop a time tracking system for employees with classes for employees, projects, and time entries. Implement methods for logging hours, generating timesheets, and calculating overtime. - Implementing a tracking system to monitor objects.
- Create a conference room booking system with classes for rooms, reservations, and users. Include methods for checking room availability, booking time slots, and sending notifications. - Booking system for conference rooms.
- Design a recipe management system with classes for recipes, ingredients, and users. Implement methods for adding recipes, searching by ingredients - Building a system to manage recipes and ingredients.
- Build a simulation of an ATM system with classes for accounts, transactions, and users. Implement methods for withdrawing cash, checking balances, and handling PIN verification. - Simulating an ATM system.
Feel free to explore the programs and use them for learning or reference purposes.
Thank you! 🙌