Python | Arbitrary arguments -
I have to take the arbitrary arguments of lists in the function
this code works fine
But when I change the code into voluntary logic and it is not working
a = [1,2,3] b = [ 5, 7] DEF adder (* M): o = [] return M + O print adder (A, B)
The reason for this can be
< / Div>
m
is a tupe with two (or more or less) lists. You need to loop through m
to get the normal version of your function
def connecter (* m): o = [] in item m: O + = item return o
You can do it in a liner, but I think it is clear.
Comments
Post a Comment