How to pass to a function regular argument and array and dictionary in Python

1 Answer

0 votes
def func(n, *arr, **dic):
    print(n, arr, dic)


func(99, 1, 2, 3, a = 3.14, b = 2.32, c = 5.56)
 

 
'''
run:
 
99 (1, 2, 3) {'a': 3.14, 'b': 2.32, 'c': 5.56}
 
'''

 



answered Jul 23, 2019 by avibootz

Related questions

...