This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Universite: | |
def __init__(self,ogrenci_adi,vize,final): | |
self.vize = vize | |
self.final = final | |
def not_hesaplama(self): | |
result = print(f'Notunuz: {(self.vize * 0.3) + (self.final * 0.7)}') | |
return result | |
#alt class | |
class Istanbul_Universitesi(Universite): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABC,abstractmethod | |
class Cokgenler(ABC): | |
@abstractmethod | |
def cevre_hesaplama(self): | |
pass | |
@abstractmethod | |
def alan_hesaplama(self): | |
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hediyelik: | |
def __init__(self,isim,fiyat,miktar): | |
self.isim = isim | |
self.__fiyat = fiyat | |
self.miktar = miktar | |
def fiyatHesapla(self): | |
self.fiyat = self.fiyat * self.miktar | |
return self.fiyat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hediyelik: | |
def __init__(self,isim,fiyat,miktar): | |
self.isim = isim | |
self.__fiyat = fiyat | |
self.miktar = miktar | |
def fiyatHesapla(self): | |
self.fiyat = self.fiyat * self.miktar | |
return self.fiyat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hediyelik: | |
def __init__(self,isim,fiyat,miktar): | |
self.isim = isim | |
self.__fiyat = fiyat #encapsülation uyguladık | |
self.miktar = miktar | |
def fiyatHesapla(self): | |
self.fiyat = self.fiyat * self.miktar | |
return self.fiyat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hediyelik: | |
def __init__(self,isim,fiyat,miktar): | |
self.isim = isim | |
self.__fiyat = fiyat | |
self.miktar = miktar | |
def fiyatHesapla(self): | |
self.fiyat = self.fiyat * self.miktar | |
return self.fiyat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hediyelik: | |
def __init__(self,isim,fiyat,miktar): | |
self.isim = isim | |
self.fiyat = fiyat | |
self.miktar = miktar | |
def fiyatHesapla(self): | |
self.fiyat = self.fiyat * self.miktar | |
return self.fiyat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Yol_Hesaplama: | |
#class object attribute | |
yol = 120 | |
#constructer | |
def __init__(self,hiz): | |
self.hiz = hiz | |
#method | |
def saat(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Circle: | |
#class object attribute | |
pi = 3.14 | |
#constructur | |
def __init__(self, yaricap=1): | |
self.yaricap = yaricap | |
#method | |
def cevre_hesapla(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_info = {"name":"Elif","tc":"15487451","year":2022,"job":"engineer"} | |
print(my_info) | |
my_info.pop("year") | |
print(my_info) |
NewerOlder