May 2017
Intermediate to advanced
280 pages
6h 2m
English
You can add two lists by using the + operator.
See the following example:
>>> Avengers1 = ['hulk', 'iron-man', 'Captain-America', 'Thor']>>> Avengers2 = ["Vision","sam"]>>>
We need a big team, so add both the lists:
>>> Avengers1+Avengers2['hulk', 'iron-man', 'Captain-America', 'Thor', 'Vision', 'sam']>>>>>> Avengers2+Avengers1['Vision', 'sam', 'hulk', 'iron-man', 'Captain-America', 'Thor']>>>>>> Avengers1['hulk', 'iron-man', 'Captain-America', 'Thor']>>>>>> Avengers2['Vision', 'sam']>>>
The original list will not be changed; the addition of lists can be saved to another variable.
Read now
Unlock full access