Tabii bu argümanları almak için **'lı bir parametre
gerekecektir.
This commit is contained in:
parent
21295bc997
commit
5058cc8c25
5
python-temel/arguman.4.py
Normal file
5
python-temel/arguman.4.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
def foo(a, b, c, d, e, **f):
|
||||
print("a = {}, b = {}, c = {}, d = {}, e = {}, f = {}".format(a, b, c, d, e, f))
|
||||
|
||||
d = {'c': 30, 'd': 40, 'e': 50, 'x': 100, 'y': 200}
|
||||
foo(10, 20, **d) # a = 10, b = 20, c = 30, d = 40, e = 50, x = 100, y = 200
|
Loading…
Reference in New Issue
Block a user