def square_list(list_to_square): '''prints each item of list_to_square squared''' for next_number in list_to_square: print(next_number ** 2) students = [('Alice', 2016), ('Bob', 2017), ('Charlie', 2019)] def print_students(student_list): '''print out the name and year of each student tuple in student_list''' for student in student_list: (name, year) = student print("Name: " + name + ", class year " + str(year)) def list_length(some_list): '''returns the length of some_list''' count = 0 for element in some_list: count += 1 return count def extract_upper(string): '''return a new string consisting only of the uppercase letters in string''' uppercase = '' for char in string: if char.isupper(): uppercase += char return uppercase