0
Tuple into a list
How can I return a list in a function with *arg. Appreciate quick help as in middle of practice
4 ответов
+ 4
Simply pass the <args> as argument to `list()` function then return the resulting list from the function.
def fun( *args ):
return list( args )
print( fun( 2021, 5, 20 ) )
+ 2
You mean return a list from a function which accepts *arg as argument? or did you mean something else?
0
Returning a list from a function which accepts *args as argument
0
list()
can converting tuple to list