Lesson 05-06: Building List Functions: extend

Learning Target: I can create a python function that will combine two lists.

Assignment

In the area below, create a function called extend() that will take in two arguments, a list called original and a list called extension. The function should alter original by adding the elements of extension onto original, keeping the same order.

You may only use the following list methods: append(), insert(), remove(), len().

Example:

list1 = [1,2,3]
list2 = [7,8,9]
extend(list1,list2)
print(list1)

This should print the following: [1,2,3,7,8,9].

 
1
def extend(original,extension):
2
    #write here
3
4

(cfu_0506_1)

Hints

Next Section - Lesson 05-08: Building List Functions: replaceAll