# Program 1: Add the elements of two lists
# Each element of the first list is added to the element in the same
# position of the second list.

list1 = [10, 20, 30, 40, 50]
list2 = [5, 15, 25, 35, 45]

result = []
for i in range(len(list1)):
    result.append(list1[i] + list2[i])

print("List 1 :", list1)
print("List 2 :", list2)
print("Sum    :", result)
print()

# Careful: the + sign does NOT add two lists element by element.
# It joins them into one longer list.
print("list1 + list2 gives :", list1 + list2)
print()

# With NumPy arrays, + does add element by element.
import numpy as np
a = np.array(list1)
b = np.array(list2)
print("Using NumPy arrays  :", a + b)
