By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,427 Members | 1,356 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,427 IT Pros & Developers. It's quick & easy.

Calling functions with dynamic arguments

P: n/a
I have a dictionary like:

{"a":1, "b":2}

and I want to call a function:

def func1(a=3,b=4):
print a,b

so that I get a=1,b=2, how can I go about that?

Thanks,
Sean

Nov 29 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
SeanDavis12 wrote:
I have a dictionary like:

{"a":1, "b":2}

and I want to call a function:

def func1(a=3,b=4):
print a,b

so that I get a=1,b=2, how can I go about that?
func1(**yourdict)

--
Roberto Bonvallet
Nov 29 '06 #2

P: n/a

Roberto Bonvallet wrote:
SeanDavis12 wrote:
I have a dictionary like:

{"a":1, "b":2}

and I want to call a function:

def func1(a=3,b=4):
print a,b

so that I get a=1,b=2, how can I go about that?

func1(**yourdict)
Thanks, Roberto.

Sean

Nov 29 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.