def fun1(a="who is you", b="True", x, y): print a,b,x,y
func1("ok a", "ok b", 1) # Is 1 assigned to x or ?
func1(1) # Is 1 assigned to a or ?
func1(1, 2) # ?
def example(a, b, c=None, r="w" , d=[], *ae, **ab):
(a,b) are positional parameter
(c=none) is optional parameter
(r="w") is keyword parameter
(d=[]) is list parameter
(*ae) is keyword-only
(**ab) is var-keyword parameter
def fun1(a="who is you", b="True", *, x, y):
In Python 3 however, you may do the following:
which makes x and y keyword only so you can do this:
fun1(x=2, y=2)