Skip to content

Instantly share code, notes, and snippets.

@SirmaXX
Created January 19, 2020 15:38
Show Gist options
  • Save SirmaXX/8e3658949b110fc7c2996e11c1bb86f3 to your computer and use it in GitHub Desktop.
Save SirmaXX/8e3658949b110fc7c2996e11c1bb86f3 to your computer and use it in GitHub Desktop.
dökümantasyon için kod örneği
#calculate.py
# -*- coding: utf-8 -*-
"""
ornek dökümantasyon için hesaplama sınıfı hazırladık
"""
class Calculation:
"""
Parametreler
------------
x:int
y:int
Dönüş tipi
-------
int
"""
def __init__(self, x, y):
self.x = x
self.y = y
#2 sayının toplamını veren fonksiyon
def sum(self):
print("toplam", self.x +self.y)
#2 sayının çarpımını veren fonksiyon
def multip(self):
print(" çarpım", self.x * self.y)
#2 sayının farkını veren fonksiyon
def subt(self):
print(" fark", self.x - self.y)
#2 sayının bölümü veren fonksiyon
def divide(self):
print("bölüm", self.x / self.y)
p1 = Calculation(12, 36)
p1.sum()
p1.multip()
p1.subt()
p1.divide()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment