python open a dictionary as keyword arguments

Solutions on MaxInterview for python open a dictionary as keyword arguments by the best coders in the world

showing results for - "python open a dictionary as keyword arguments"
Carl
26 Sep 2016
1def test_func(a = 4, b = 5):
2    print("The value of a is : " + str(a))
3    print("The value of b is : " + str(b))
4  
5# initializing dictionary
6test_dict = {'a' : 1, 'b' : 2}
7  
8# Passing dictionary as keyword arguments
9# Using ** ( splat ) operator
10print("The function values with splat operator unpacking : ")
11test_func(**test_dict)
12