This is a beginner-friendly Python project that demonstrates the core principles of Object-Oriented Programming (OOP). The program defines a Car class with attributes like brand, model, and year, and provides methods to simulate starting the engine, driving, and displaying car details.
- β Create multiple car objects with different attributes
- β Start the engine of each car
- β Simulate driving behavior
- β Display car information
- β Clear and modular OOP structure for learning and extension
| Method | Description |
|---|---|
__init__ |
Initializes a new car with brand, model, and year |
start_engine |
Prints that the car's engine has started |
drive |
Prints that the car is now driving |
details |
Displays full car details |
- Clone the repository:
git clone https://github.com/ZiyadAzzaz/Car-Class-Python-OOP.git
cd Car-Class-Python-OOP
- Run the script:
python car.py
The Engine of Mercedes S-Class Has Started
Mercedes S-Class is Now Driving
Car Details: Mercedes S-Class 2024
- Understand how to define and instantiate Python classes
- Learn constructor usage (
__init__) - Practice encapsulating attributes and behavior
- Build foundational knowledge for more advanced OOP systems
- Car rental system
- Vehicle inventory database
- Driving simulation
- Garage management app
This project is open-source and available under the MIT License.
Pull requests, improvements, and forks are welcome! If you'd like to add more features (like file saving, GUI, or inheritance), feel free to contribute.
Developed by Ziyad Azzaz
GitHub: https://github.com/ZiyadAzzaz