- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobject_oriented.py
More file actions
Latest commit
19 lines (15 loc) · 571 Bytes
/
Copy pathobject_oriented.py
File metadata and controls
19 lines (15 loc) · 571 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
classAraba():
'''
Self methodu mevcut objeyi gösteren referanstır
Her Fonksiyonun başında mutlaka olması gerekir.
'''
# Contructor - Obje oluşturulurken otomatik çalışır
def__init__(self, marka, model, yıl):
print('Yeni bir araba oluşturuldu')
self.marka=marka
self.model=model
self.yıl=yıl
defshow_car_information(self):
print("""Araba Markası : {} Model: {} Yılı : {}"""
.format(self.marka, self.model, self.yıl))
araba=Araba('BMW', '320d', 2018)