-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfunctions.py
48 lines (34 loc) · 953 Bytes
/
functions.py
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
44
45
46
47
48
def sayHello(name = 'user'):
return 'Hello '+ name
msg = sayHello('Çınar')
msg = sayHello('Ada')
print(msg)
def total(num1, num2):
return num1 + num2
result = total(10,20)
result = total(15,20)
print(result)
def yasHesapla(dogumYili):
return 2019 - dogumYili
ageCinar = yasHesapla(2017)
ageAda = yasHesapla(2010)
ageSena = yasHesapla(1999)
print(ageCinar, ageAda, ageSena)
def EmekliligeKacYilKaldi(dogumYili, isim):
'''
DOCSTRING: Dogum yiliniza gore emekliliginize kac yil kaldı
INPUT: Dogum yili
OUTPUT: Hesaplanan yil bilgisi
'''
yas = yasHesapla(dogumYili)
emeklilik = 65 - yas
if emeklilik > 0:
print(f'emekliliğinize {emeklilik} yıl kaldı')
else:
print('Zaten emekli oldunuz')
EmekliligeKacYilKaldi(1983, 'Ali')
EmekliligeKacYilKaldi(1950, 'Ahmet')
EmekliligeKacYilKaldi(1974, 'Yağmur')
print(help(EmekliligeKacYilKaldi))
list = [1,2,3]
print(help(list.append))