Q:

Write a Python program to create a Vehicle class with max_speed and mileage instance attributes.

-3

Create a Class with instance attributes

Write a Python program to create a Vehicle class with max_speed and mileage instance attributes.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

class Vehicle:
    def __init__(self, max_speed, mileage):
        self.max_speed = max_speed
        self.mileage = mileage

modelX = Vehicle(240, 18)
print(modelX.max_speed, modelX.mileage)

 

Explanation:

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now