# Allison Obourn
# CSC 110, Spring 2018
# Lecture 24

# merges two lists into a new list with the contenst
# of the first first and the second second. 

def main():
    list1 = [1, 2, 3, 4]
    list2 = [5, 6, 7, 8]
    list3 = merge(list1, list2)
    print(list3)

# takes two lists as parameters. Merges them into
# one list and combines them with the contents of
# list1 first and the contents of list2 second.
# returns the new list
def merge(list1, list2):
    list3 = [0] * (len(list1) + len(list2))
    for i in range(len(list1)):
        list3[i] = list1[i]
    for i in range(len(list2)):
        list3[i + len(list1)] = list2[i]
    return list3
    

main()
    
