range yıldız ve tek yıldız argüman / parametre

This commit is contained in:
Mert Gör ☭ 2023-05-24 14:46:59 +03:00
parent 2d52917c70
commit c34ef8c83b
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
2 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,7 @@
def foo(a, b, c, *d):
print('a = {}, b = {}, c = {}, d = {}'.format(a, b, c, d))
foo(100, *range(10))
#Buradaki çağrının eşdeğeri şöyledir:
#foo(100, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)

View File

@ -0,0 +1,4 @@
def foo(a, b, *c):
print('a = {}, b = {}, c = {}'.format(a, b, c))
l = [10, 20, 30, 40, 50]
foo(10, 20, *l)