# Sample Lab Exam 1 - Solutions # In your labexam1 folder in the file f1.py def f1(list): sum = 0 for i in range(0,len(list)): if list[i]%3 == 0: sum = sum + list[i] return sum # In your labexam1 folder in the file f2.py def f2(list,start,finish): new_list = [] for i in range(start,finish+1): if list[i]%2 == 0: new_list.append("even") else: new_list.append("odd") return new_list # In your labexam1 folder in the file f3.py def f3(list): last = None for i in range(0,len(list)): if list[i] == "food": last = i return last # In your labexam1 folder in the file f4.py def f4(n): for i in range(1,n+1): for j in range(1,n+1): print(i*j, end = " ") print() return None