Created
January 19, 2020 15:38
-
-
Save SirmaXX/8e3658949b110fc7c2996e11c1bb86f3 to your computer and use it in GitHub Desktop.
dökümantasyon için kod örneği
This file contains 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
#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