# (*args **kwargs is optional too, if you use these as a parameter for a function, then you don't pass them. it will not return any error, that means it's optional, your code will be executed ! :-D
def function(n1, n2, n3, n4):
print(n1, n2, n3, n4) # in this function we have limited parameter so, we can pass limited arguments, right?
# boring, because thousand of users name can't be pass here 🥴, hence, we can use (*args) parameter handle them 🙂
function('Johny', 'Silverhand', 'Arasaka', 'Cyberpunk')
def func1(*args):
print(args)
func1(*[5, 5,5,567]) # al elements are passes to the func1 one by one...... (remember * symbol is given in both sector 🙂)
# |||||||||| Note: here input List are passed as Tuple, that's why output is ('hello', 'nc', 'ara')... , so (*args) takes List, tuple, or set as 'Tuple' .... |||
# and we have also (**kwargs) too... let's seee......
# def func2(**kwargs)
0 Comments