Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Using **kwargs to pass the variable keyword arguments to the function

# Welcome to softhunt.net
def intro(**data):
    print("
Data type of argument:",type(data))

    for key, value in data.items():
        print("{} is {}".format(key,value))

intro(Firstname="Ranjeet", Lastname="Kumar", Age=22, Phone=1122334455)
intro(Firstname="Softhunt", Lastname=".net", Email="softhunt.net@gmail.com", Country="Pakistan", Age=22, Phone=1122334455)
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Using #pass #variable #keyword #arguments #function
ADD COMMENT
Topic
Name
8+7 =