Following is my function :
def compare(a, b, key=None,*arg2):
print(a,b,key)
So in this how do we call the function without specifying value for the key, but providing value for the arg2 tuple...
Thanks.
Following is my function :
def compare(a, b, key=None,*arg2):
print(a,b,key)
So in this how do we call the function without specifying value for the key, but providing value for the arg2 tuple...
Thanks.
If I am not wrong You want to pass default value of variable key. If so you can change the order of the variables. like this
def compare(a, b,*arg2,key=None):
print(a,b,key,arg2)
compare(2,3,12,134,135,35,4567647,67865)
#output: 2 3 None (12, 134, 135, 35, 4567647, 67865)