1. 程式人生 > >python函式中,雙星號**的作用

python函式中,雙星號**的作用

https://www.geeksforgeeks.org/packing-and-unpacking-arguments-in-python/ 

https://blog.csdn.net/xiaoqu001/article/details/78823498

** is used for dictionaries

# A sample program to demonstrate unpacking of

# dictionary items using **

def fun(a, b, c):

    print(a, b, c)

 

# A call with unpacking of dictionary

d = {'a':2, 'b':4, 'c':10}

fun(**d)