Here is the data:
testdata = {
'a' : 1,
'b': 2
}
There are two ways to pass the data to a function
Passing the data to the function
def loop(data): for key, value in data.items(): print(key, value) loop(testdata)
Passing the data with operator: **
def loopStar(**kwargs): for key, value in kwargs.items(): print(key, value) loopStar(**testdata)
Scan the QR code using WeChat