[Tutor] Passing Dictionaries to Functions

Kent Johnson kent37 at tds.net
Wed Mar 15 14:56:41 CET 2006


Ed Singleton wrote:
> If I have a dictionary:
> 
> mydict{'var1':"a", 'var2':"b"}

Presumably you mean
   mydict = {'var1':"a", 'var2':"b"}
> 
> and I want to pass it to a function as:
> 
> myfunc(var1="a", var2="b")
> 
> How would I do it?

myfunc(**mydict)

Kent



More information about the Tutor mailing list