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


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

Source: python

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.