Adding Chapter 3 files

This commit is contained in:
muassif
2021-01-16 15:14:59 +04:00
committed by GitHub
parent abab477fe1
commit d78cf1f8e9
17 changed files with 402 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
#carexampl4.py
class Car:
c_mileage_units = "Mi"
def __init__(self, color, miles):
self.i_color = color
self.i_mileage = miles
def __str__(self):
return f"car with color {self.i_color} and mileage {self.i_mileage}"
if __name__ == "__main__":
car1 = Car ("blue", 1000)
print (str(car1))
print(repr(car1))
print(dir(car1))