Answers for "spread dictionary python"

0

spread dictionary python

// add '**' before dict:
function(**dict)

// Example:

def add(a=0, b=0):
    return a + b
  
d = {'a': 2, 'b': 3}
add(**d)
5
Posted by: Guest on July-18-2021

Python Answers by Framework

Browse Popular Code Answers by Language