# Assignment 5
# Name:
# Block:
#
# Task A: Mean of a List
# Write a function called mean(myList) that calculates the average value of
# myList, where myList is a list of numbers. To find the average, add up all the
# numbers in the list and then divide it by the length of the list. The function
# does not need to consider exceptions but it does need to use a while loop.
#
def mean(myList):
# code goes below
# Test Cases:
list1 = [4, 7, 9, 3]
list2 = [7.8, 9.5, -3.2]
mean(list1) # 5.75
mean(list2) # 4.7
# Task B: Search
# Write a function called search(myList, x) that searches for myList for the
# number x. The function returns the first index with the exact match. If the
# number x is not in myList, then the function returns None.
#
def search(myList, x):
# code goes below
# Test Cases:
search([4, 7, 9, 3], 9) # 2
search([3, 1, 4, 1, 5, 9], 1 )# 1
search([9, 1, 1], 8) # None