0

why is this not working?

class vehicle : def __init__(self, nof, length) : self.nof = nof # number of wheels self.length = length def __str__(self): return f'{self.nof}, {self.length}' def __repr__(self) : return f'{self.nof}, {self.length}' def wcap(self): n = self.nof l = self.length return n * l * 100 class bus(vehicle) : def __init__(self, length): super().__init__(length, length) class car(bus): def __init__(self, length): super().__init__(length) def maxpass(self) : a = self.lenght return a *3 class mc(vehicle) : def maxspeed(self): l = self.length n = self.nof return (l * n)**3 class bike(mc) : def intro(self): return "Bikes are just like mcs but without the heavy engine!" a = mc(2,2) a.maxspeed() b= bike(2,3) b.intro()

1st May 2022, 2:19 AM
Lenoname
1 Answer
+ 3
You are calling the methods maxspeed and intro, which are returning something but you never print the result. You should save your code in the playground and link it to your question, so that others have a more convenient way to test it and help you. https://www.sololearn.com/Discuss/333866/?ref=app
1st May 2022, 2:30 AM
Tibor Santa
Tibor Santa - avatar