Question: use py only Define the get_fail_pass_ave rage( ) function which is passed a list of integers called number_list as a parameter where each integer represents
use py only


Define the get_fail_pass_ave rage( ) function which is passed a list of integers called number_list as a parameter where each integer represents a mark out of 100. The function returns a Python list made up of the average of all the marks which are less than 50, followed by the average of all the marks which are 50 or more (both averages are rounded to the nearest whole number). If there are no fail marks then the average fail mark should be set to 1 and if there are no pass marks then the average pass mark should be set to -1. Some examples of the function being called are shown below. For example: m print(get_fail_pass_average([63, 65, 331)) [33, 64] print(get_fail_pass_averagel[63, 62, 100, 1001)) print(get_fail_pass_averagel[33, 42, 20, 101)) [26, -1] Define the get_longest_two_s_word( ) function which is passed a list of strings called word_list as a parameter. The function returns the word in the list which has the most characters (i.e., the longest word) BUT only words which have 5 or more characters and contain at least two 's' (or 'S') characters. If two or more words in the list have the same number of characters as the longest word and both contain at least two 's' characters, the function should return the first word from the start of the list which has the most characters. If the parameter list is empty or if there are no 5 letter or longer words in the list which contains at least two 's' characters, the function should return the empty string. Some examples of the function being called are shown below. Hint: Defining a helper function to count the number of "S" and "s" characters in a string would be useful. For example: Test Result print ("1.", get_longest_two_s_word( ["posters", "cases", "tenses", "digests", "gaseous"]) ) 1. posters print ("2.", get_longest_two_s_word( ["Jo", "Jessy", "Penelope", "Jin", "Raeann", "Susan"]) ) 2. Jessy print ("3. ", "***", get_longest_two_s_word( ["Alan", "Melita", "Amity", "Rosalia", "Rositta", "LeeAnne"] ), "***", sep = "") 3. * ***** print ("4. "***", get_longest_two_s_word( ["pass", "less", "sows", "mess", "saps", "Jess"]), "***", sep = "") 4. ****** print ("5. "***", get_longest_two_s_word( ), "***", sep = "") 5. * ***** print ("6. ", "***" + get_longest_two_s_word( ["ShuSHI!"] ) + "***") 6. ***ShuSHI !***
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
