Build a Basic Car Class

Medium Introduction to OOP & Basic Classes PRO
🔒 Login to Unlock

Problem Statement

Create a `Car` class with `make`, `model`, and `year` attributes. Add a method `display_info` that prints multi-line details using a specific format. Read three lines of input for these attributes, instantiate the car, and call its display_info method.

Input Format

Three lines containing make, model, and year respectively.

Output Format

Print the car details separated by newlines.

Constraints

None

Sample Input

Toyota
Corolla
2020

Sample Output

Make:  Toyota
Model: Corolla
Year:  2020

Explanation

Combines attributes and behavior (methods) into a functional class model with specific spacing requirements.

Starter Code

class Car:
    # Write __init__ and display_info methods
    pass

if __name__ == '__main__':
    # Read inputs, create Car, and call display_info
    pass

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used