Skip to content

A beginner-level Python program that demonstrates object-oriented programming using a Car class with basic methods like start_engine, drive, and show details.

License

Notifications You must be signed in to change notification settings

ZiyadAzzaz/Car-Class-Python-OOP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš— Car Class in Python

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.


🧠 Features

  • βœ… 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

🧱 Class Structure

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

πŸ“ How to Run

  1. Clone the repository:
git clone https://github.com/ZiyadAzzaz/Car-Class-Python-OOP.git
cd Car-Class-Python-OOP
  1. Run the script:
python car.py

πŸ‘‰ View the Full Code Here


πŸ’‘ Example Output

The Engine of Mercedes S-Class Has Started
Mercedes S-Class is Now Driving
Car Details: Mercedes S-Class 2024

🎯 Learning Objectives

  • 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

πŸ“Œ Use Cases for Expansion

  • Car rental system
  • Vehicle inventory database
  • Driving simulation
  • Garage management app

πŸ“„ License

This project is open-source and available under the MIT License.


πŸ™Œ Contributing

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.


πŸ‘¨β€πŸ’» Author

Developed by Ziyad Azzaz
GitHub: https://github.com/ZiyadAzzaz

About

A beginner-level Python program that demonstrates object-oriented programming using a Car class with basic methods like start_engine, drive, and show details.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages