I use Python 3.6.3 and visual studio code
x=[],y=[]'a=[],d+[],i=0
a = ['Al', 'red', '1', '1', 'blue', 'green','', '65', \
'Bill', 'yellow', '1', '2', 'blue', 'red','', '55', \
'Alice', 'pink', '1', '3', 'blue', 'green','', '66', \
'Fred', 'pink', '1', '4', 'orange', 'puce','', '65]
for p in range(1,5):
x=[a[2+i]]
y=[a[3+i]]
d(x,y)=a[0:8] # variables x and y on left of = sign.
i=i+8
print(d('1','2'))
print(d('1','3')[0])
# want to get the following
'Bill', 'yellow', '1', '2', 'blue', 'red','', '55'
'Alice'
My question is: In Python, can variables be used on the
left side of the =
sign? What data structure or what else
would do it? It worked in BASIC.
Why would I want to do this? Imagine I have 1000 groups instead of just these 4.
When I get answers, how do I acknowledge and approve or whatever I need to do. I haven't found a guide yet.