I'm trying to do something like this in python:
def f():
b = ['c', 8]
return 1, 2, b*, 3
Where I want f
to return the tuple (1, 2, 'c', 8, 3)
. I found a way to do this using itertools
followed by tuple
, but this is not very nice, and I was wondering whether there exists an elegant way to do this.
def func(): list1 = [1,2,3] return *list1
is there's a way to achieve this usingprint(*list1)
is possible but I would like to return in formatted string or just normally – Naturalism