forked from hussien89aa/PythonTutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOOPKwarges.py
More file actions
28 lines (20 loc) · 660 Bytes
/
Copy pathOOPKwarges.py
File metadata and controls
28 lines (20 loc) · 660 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class Car:
def __init__(self,**kwargs):
self.Data=kwargs
def GetOwner(self):
print("Owner Name ",self.Data["Name"])
print("Car Model ",self.Data["Model"])
print("Year ",self.Data["Year"])
def Set_Model(self,Model):
self.Data["Model"]=Model
def Get_Model(self):
print("Car Model ",self.Data["Model"])
def main():
mycar=Car(Name="Hussein Alrubaye",Model="camer 2015",Year=2015)
mycar.GetOwner()
Jencar=Car(Name="Jen Alrubaye",Model="sony x",Year=2015)
Jencar.GetOwner()
#jen model set
Jencar.Set_Model("2016")
Jencar.Get_Model()
if __name__ == '__main__':main()