Sample questions - Rewrite the following function to improve the style: def longwinded(a, b, c): if a > b: if a > c: return True else: return False else: return False - What does the following function do (in one sentence) assuming x is a list: def mystery(x): if len(x) <= 1: return True else: if x[0] > x[1]: return False else: return mystery(x[1:]) - Write a function that takes two parameters: a dictionary and a number. The function should add the number to each value in the dictionary. - Write a matlab function called sum_first that takes a matrix as a parameter and returns the sum of the first column of the matrix - Write a function that takes a string as a parameter and returns the string with all the uppercase letters removed. Hint, the isupper method may be useful. ----------- Some others that we didn't look at in class: - Write a recursive function all_upper that takes a list of strings as a parameter and returns True all of the strings in the list are all uppercase, False otherwise. Recall that the string class has an "isupper()" method that checks if it is all uppercase. - What decimal numbers are represented by the following binary numbers: a. 1101 b. 111 c. 10010 - Write a matlab statement to generate the following matrix: 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 0