I'm working with an API that returns variables in this format:
[x, y]
How can I take that and turn it into individual x and y variables?
I'm working with an API that returns variables in this format:
[x, y]
How can I take that and turn it into individual x and y variables?
You could do
first, second = somethingReturned
If you are passing the data you retrieve from your API to another function, you don't have to unpack them by hand, just use the star operator.
my_func(*api_func())