Exercises: 1. Define a function max() that takes two numbers as arguments and returns the largest of them. 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.) 2. Write a function that takes a character (i.e. a string of length 1) and returns True if it is a vowel, False otherwise. 2.1. Use the module re (regular expressions) 3. Define a function is_palindrome() that recognizes palindromes (i.e. words that look the same written backwards). For example, is_palindrome("radar") should return True. 3.1. Use the module sys to run the program from the terminal getting the string as a parameter in the terminal. 4. Define a procedure histogram() that takes a list of integers and prints a histogram to the screen. For example, histogram([4, 9, 7]) should print the following: **** ********* ******* 5. Write a program that maps a list of words into a list of integers representing the lengths of the correponding words. Write it in three different ways: 1) using a for-loop, 2) using list comprehensions 6. Write a version of a palindrome recogniser that accepts a file name from the user, reads each line, and prints the line to the screen if it is a palindrome. 7. Write a program able to play the "Guess the number"-game, where the number to be guessed is randomly chosen between 1 and 20. (Source: http://inventwithpython.com) This is how it should work when run in a terminal: Output of the program (example): Hello! What is your name? Torbjörn Well, Torbjörn, I am thinking of a number between 1 and 20. Take a guess. 10 Your guess is too low. Take a guess. 15 Your guess is too low. Take a guess. 18 Good job, Torbjörn! You guessed my number in 3 guesses! 8. Your task in this exercise is as follows: Generate a string with N opening brackets ("[") and N closing brackets ("]"), in some arbitrary order. Determine whether the generated string is balanced; that is, whether it consists entirely of pairs of opening/closing brackets (in that order), none of which mis-nest. Examples: [] OK ][ NOT OK [][] OK ][][ NOT OK [[][]] OK []][[] NOT OK