def max_of_three(first, second, three): largest = max(first, second) return max(largest, three)
def max_of_three(a, b, c): max_temp = max(a, b) return max(max_temp, c)
def find_longest_word(words): return max(map(len, words))
def find_longest_word(words): return max(map_list_to_len(words))
Use the if-then-else construct available in Python. (It is true that Python has the max() function built in, but writing it yourself is nevertheless a good exercise.) """ def max(a, b): if a > b: return a elif b > a: return b else: return None if __name__ == "__main__": print max(2, 5) print max(5, 2) print max(5, 5) ###########ex2 #!/usr/bin/env python """ Define a function max_of_three() that takes three numbers as arguments and returns the largest of them. """ from ex1 import max def max_of_three(a, b, c): max_temp = max(a, b)