Python operator: double start(**)

Posted by Blog - uTIcARdI on December 21, 2018

Here is the data:

testdata = {
    'a' : 1,
    'b': 2
}

There are two ways to pass the data to a function

  1. Passing the data to the function

    def loop(data):
        for key, value in data.items():
            print(key, value)
    
    loop(testdata)
    
  2. Passing the data with operator: **

    def loopStar(**kwargs):
        for key, value in kwargs.items():
            print(key, value)
    
    loopStar(**testdata)
    

Python operator: double start(**)


donation

Scan the QR code using WeChat

comments powered by Disqus