python - Is there any way to choose if a default parameter is used for a function? -


for example:

def tune(a=2,b=3,c=4):     return str(a) + " " + str(b) + " " + str(c)   print tune(5, *default*, 7) 

so output be:

5 3 7 

what put in place of *default* make happen?

use default named arguments. explicitly mention c has take value of 7

>>> print tune(5, c= 7)  5 3 7 

Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -