JavaScript
x
2
1
var = ('3', [11, 13, 11, 11])
2
I want to convert it into something like this:
JavaScript
1
2
1
3 11 13 11 11
2
so that I can pass it into another function
JavaScript
1
3
1
foo(*args):
2
3
Advertisement
Answer
You could use iterable unpacking to do this.
You can unpack an iterable by prefixing it with *
when passing it into a function.
foo(int(var[0]), *var[1])
would give you what you want.