In order not to use so many lines to declare variables like this:
open = []
high = []
low = []
close = []
Could I do something like this:
open,high,low,close = []
That actually works
No. The example in your question will not work. It will raise a ValueError. This is because Python is attempting to unpack four values into open, high, low, and closed, but if finds no valuest(this will raise an error in both Python 2.x and Python 3.x):
>>> open, high, low, close = []
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: not enough values to unpack (expected 4, got 0)
>>>
To initialize all of the lists variables on the same line, you need to provide a list for all four variables:
>>> open, high, low, closed = [], [], [], []
>>>
>>> open
[]
>>> high
[]
>>> low
[]
>>> closed
[]
>>>
ValueError: need more than 0 values to unpackin py27 andValueError: not enough values to unpack (expected 4, got 0)in py35.