# Exercice 2 : Modify

# 1)

courses = ('pain', 'BBQ', 'lait', 'gel')
print(courses[0]) # pain
print(courses[3]) # lait

# 2)

# Code 3 # Code 4
notes = (20, 15, 15, 17)
m = 0
for i in range(len(notes)):
    m = m + notes[i]
print(m/len(notes))

# 3)

notes = (20, 15, 15, 17)
coef = (1, 2, 3, 1)
m = 0
c = 0
for i in range(len(notes)):
    m = m + notes[i]*coef[i]
    c = c + coef[i]
print(m/c)

# 4)

def somme(t1, t2):
    return (t1[0] + t2[0], t1[1] + t2[1])

print(somme((1,2), (3,4))) # (4, 6)
