Ways of code shortening in mass list appendices in Python?

Say I have

>>>a = [1]
>>>b = [2]
>>>c = [3]

How can I turn them into something like

a = [1, 2]
b = [2, 3]
c = [3, 8]

(No clear pattern)
Without manually doing something like

>>>a.append[2]
>>>b.append[3]
>>>c.append[8]

Once more variables are added, it’ll obviously get much more tedious.


Source: python

Leave a Reply