Mega Code Archive

 
Categories / Python Tutorial / Function
 

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)