Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f22f736

Browse files
Esnek Parametreli Fonksiyon Uygulaması
1 parent 4ce26a2 commit f22f736

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

‎.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
def toplam(*sayılar):
2+
toplama = 0
3+
for topla in sayılar:
4+
toplama += topla
5+
return toplama
6+
7+
8+
def sayıSor():
9+
10+
a = input("Yeni sayı eklemek istiyorsanız (Y), İşlemi tamamlamak için (T) tuşlayınız: ")
11+
if a == "Y":
12+
return True
13+
elif a == "y":
14+
return True
15+
elif a == "T":
16+
return False
17+
elif a == "t":
18+
return False
19+
else:
20+
print("Yanlış giriş yaptınız.\nTekrar giriniz")
21+
sayıSor()
22+
23+
print("""
24+
Toplama İşlemini fonksiyonda esnek sayılar kullanarak
25+
işlem yapmayı amaçlayan programımıza hoşgeldiniz...
26+
27+
*******************
28+
""")
29+
30+
kontrol = True
31+
sayı_listesi = []
32+
33+
while kontrol == True:
34+
sayı_listesi.append(int(input("Sayı giriniz:")))
35+
kontrol= sayıSor()
36+
print("Girmiş olduğunuz sayıların toplamı:",toplam(*sayı_listesi))
37+
38+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /