This sounds like a super easy question, so I'm surprised that searching didn't yield any results: I want to initialize a list of constants and extend it with a list from another source.
This works:
remoteList = [2, 3, 4]
myList = [0,1]
myList.extend(remoteList)
Which means it gives the expected results:
myList
[0, 1, 2, 3, 4]
However, doing the list initialization in one line doesn't work, myList is left undefined:
remoteList = [2, 3, 4]
myList = [0,1].extend(remoteList)
Is there a way to initialize the list and extend it with another list (in a pythonic way) in one line? Why doesn't my one line example work, or at least produce some sort of list?