0

I have a list a = [1, 2, 3] and I want to create an extension called b = [1, 2, 3, 4].

I don't want to overwrite a, so I can not use append, extend or insert. I wonder if there is a quick method for the job (faster than using a list of comprehension or deep.copy)

ironzionlion
  • 832
  • 1
  • 7
  • 28

1 Answers1

0

You can do this, simple:

b = a + [4]
Zain Arshad
  • 1,885
  • 1
  • 11
  • 26