Peter Otten wrote:
> Mehrzad Irani wrote:
>
>> Hi All,
>>
>> Consider the situation
>> [cti@iranim-rhel python_cti]$ cat a.py
>> def a(a = 1, b = 2, c = 3, *d, **e):
>> print(a, b, c)
>> print(d)
>> print(e)
>>
>> r = {'e': 7, 'f': 8, 'g': 9}
>>
>>
>> a(**r)
>> a(3, **
The way you defined the function:
def a(a = 1, b = 2, c = 3, *d, **e):
print(a, b, c)
print(d)
print(e)
a, b and c are positional arguments. d will be filled with the excess arguments
and e will receive a dictionary, if supplied.
One thing is the function definition, ano
Mehrzad Irani wrote:
> Hi All,
>
> Consider the situation
> [cti@iranim-rhel python_cti]$ cat a.py
> def a(a = 1, b = 2, c = 3, *d, **e):
> print(a, b, c)
> print(d)
> print(e)
>
> r = {'e': 7, 'f': 8, 'g': 9}
>
>
> a(**r)
> a(3, **r)
>
> r1 = (4,5,6)
>
> a(3,2,1,*r1,
Hi All,
Consider the situation
[cti@iranim-rhel python_cti]$ cat a.py
def a(a = 1, b = 2, c = 3, *d, **e):
print(a, b, c)
print(d)
print(e)
r = {'e': 7, 'f': 8, 'g': 9}
a(**r)
a(3, **r)
r1 = (4,5,6)
a(3,2,1,*r1, **r)
a(*r1, **r)
r1 = (4,5,6,7)
a(*r1, **r)
[cti@iranim