demet eleman fonksiyon

This commit is contained in:
Mert Gör 🇹🇷 2023-05-27 10:31:09 +03:00
parent 61039b38d5
commit c5b0de1f2b
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9

View File

@ -0,0 +1,12 @@
def add(*a):
total = 0
for x in a:
if isinstance(x, (list, tuple)):
total += sum(x)
else:
total += x
return total
x = [20, 30]
result = add(10, x, 40)
print(result)