1- """Car and zVehicke classes
1+ """Car, Device, and Vehicle classes
22
33Used to demonstrate object oriented techniques in Java vs Python
44"""
@@ -27,7 +27,7 @@ class Car(Vehicle, Device):
2727 wheels = 0
2828
2929 def __init__ (self , color , model , year ):
30- """Call our oarent classes, then define the year."""
30+ """Call our parent classes, then define the year."""
3131 Vehicle .__init__ (self , color , model )
3232 Device .__init__ (self )
3333 self .year = year
@@ -43,18 +43,18 @@ def voltage(self):
4343
4444 @voltage .setter
4545 def voltage (self , volts ):
46- """Warn the user before resetting the voltage. """
46+ """Warn the user before resetting the voltage"""
4747 print ("Warning: this can cause problems!" )
4848 self ._voltage = volts
4949
5050 @voltage .deleter
5151 def voltage (self ):
52- """Warn the user beore deleting the voltage. """
52+ """Warn the user beore deleting the voltage"""
5353 print ("Warning: the radio will stop working!" )
5454 del self ._voltage
5555
5656 def __str__ (self ):
57- """Imorived human readable version of the object. """
57+ """Improved human readable version of the object"""
5858 return f"Car { self .color } : { self .model } : { self .year } "
5959
6060 def __eq__ (self , other ):
@@ -66,7 +66,7 @@ def __lt__(self, other):
6666 return self .year < other .year
6767
6868 def __add__ (self , other ):
69- """Add the objects together in our oredefined way."""
69+ """Add the objects together in our predefined way."""
7070 return Car (
7171 self .color + other .color ,
7272 self .model + other .model ,
0 commit comments