Parameters can be passed as a dictionary using the ** syntax. : Default Arguments : Function PYTHON TUTORIALS


PYTHON TUTORIALS » Function » Default Arguments »

 

Parameters can be passed as a dictionary using the ** syntax.


def fun(name, location, year=2006):
    print "%s/%s/%d" (name, location, year)

dictionary = {'name':'Brendan','location':'Orlando', 'year':1999}
fun(**dictionary)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Function
» Default Arguments