1

I have written a function with different type of arguments named, default, arbitrary, keyword arguments.

def my_func(x,y=4, *args, **kwargs):
    print(kwargs)
    print(args)

When I call this function,

my_func(2,3,4,5,6,7,8,a=40,b=90)

the arguments taken are as follows..

x = 2, 
y = 3,
args = [4, 5, 6, 7, 8]
kwargs = {a:40, b:90}

But what I want is, since y has default value, I want to skip it. the arguments should be taken as,

x = 2,
y = 4,
args = [3, 4, 5, 6, 7, 8]
kwargs = {a:40, b:90}

Is there any possibility to do this?

Thank you very much.

0 Answers0