logo

Crowdly

Browser

Add to Chrome

Olgu meil järgnev kood: class Engine:     def __init__(self, hp,...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Olgu meil järgnev kood:

class Engine:

    def __init__(self, hp, type):

        self.hp = hp

        self.type = type

    def start(self):

        print(f"{self.type} engine with {self.hp} horsepower started")

class Car:

    def __init__(self, make, model, engine):

        self.make = make

        self.model = model

        self.engine = engine

    def start(self):

        print(f"starting {self.make} {self.model}")

        self.engine.start()

car = Car("Audi", "A7", Engine(280, "V6"))

car.start()

Mis prinditakse konsooli?

0%
0%
More questions like this

Want instant access to all verified answers on moodle.taltech.ee?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome