Function Name: countSheets() Parameters: aList (list) Returns: total (int) or error message (str) Description: As you kn
Posted: Mon Jun 06, 2022 1:50 pm
Function Name: countSheets() Parameters: aList (list) Returns: total (int) or error message (str) Description: As you know your TAs have to print your recitation sheets before every recitation. But due to limited budget, every TA is allowed to print twenty copies (at most) for every recitation. Help them distribute the work! Write a function that takes in a list which contains the name of the TAS and the number of copies they want to print. Return the total number of copies that will be printed out. If anyone in the list wants to print more than 20 copies, then return a string with an error message that says: "Sorry {name of TA}, but you can only print a maximum of 20 copies per person." If there is more than one TA who wants to print more than 20 copies, then return the error message using the name of the first person who demanded above the maximum. Note: The list will always follow the order [name, # of copies, name, # of copies, ...] >>> countSheets(["Karthik", 10, "Coco", 20, "Claire", 5]) 35 >>> countSheets(["Anupama", 10, "Coco", 30, "Karthik", 40, "Ankita", 15]) 'Sorry Coco, but you can only print a maximum of 20 copies per person.'