demo_ref_list_extend.py:
fruits = ['apple', 'banana', 'cherry'] cars = ['Ford', 'BMW', 'Volvo'] fruits.extend(cars) print(fruits)
➜ begtut>python demo_list_extend.py
['apple', 'banana', 'cherry', 'Ford', 'BMW', 'Volvo']