return example 4

This commit is contained in:
Mert Gör 🇹🇷 2023-05-23 10:06:56 +03:00
parent 0ae054b0e5
commit fa0b7c73b8
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9

11
python-temel/return.4.py Normal file
View File

@ -0,0 +1,11 @@
def gettotal(l):
total = 0
for i in l:
total += i
return total
result = gettotal([1, 2, 3, 4, 5])
print(result)
result = gettotal(range(10))
print(result)