-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoopArabaOrnegi.py
More file actions
46 lines (33 loc) · 887 Bytes
/
oopArabaOrnegi.py
File metadata and controls
46 lines (33 loc) · 887 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
class Araba():
marka=""
model=""
renk=""
durum=""
def marka_atama(self, marka):
self.marka=marka
def model_atama(self,model):
self.model=model
def renk_atama(self,renk):
self.renk=renk
def durum_atama(self,durum):
self.durum=durum
def calistir(self):
self.durum="Çalışıyor"
def durdur(self):
self.durum="Çalışmıyor"
def durumu_yazdir(self):
print(f"Durumu:{self.durum}")
#-----------------------------
sedan=Araba()
sedan.marka_atama("Toyota")
print(f"Markası: {sedan.marka}")
sedan.model_atama("Corolla")
print(f"Modeli: {sedan.model}")
sedan.renk_atama("Beyaz")
print(f"Rengi: {sedan.renk}")
sedan.durumu_yazdir()
sedan.calistir()
sedan.durumu_yazdir
print("***********************")
sedan.durdur()
sedan.durumu_yazdir()