11. Define a function generate_n_chars() that takes an integer n and a character c and returns a string, n characters long, consisting only of c:s. For example, generate_n_chars(5,"x") should return the string "xxxxx". (Python is unusual in that you can actually write an expression 5 * "x" that will evaluate to "xxxxx". For the sake of the exercise you should ignore that the problem can be solved in this manner.)

Captura de pantalla 2017-02-13 a la(s) 10.05.01.png

Captura de pantalla 2017-02-13 a la(s) 10.05.32.png

12.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:

****
*********
*******

Captura de pantalla 2017-02-13 a la(s) 10.06.24.png

Captura de pantalla 2017-02-13 a la(s) 10.06.53.png

13. The function max() from exercise 1) and the function max_of_three() from exercise 2) will only work for two and three numbers, respectively. But suppose we have a much larger number of numbers, or suppose we cannot tell in advance how many they are? Write a function max_in_list() that takes a list of numbers and returns the largest one.

Captura de pantalla 2017-02-13 a la(s) 10.17.04.png

Captura de pantalla 2017-02-13 a la(s) 10.17.29.png

14. Write a program that maps a list of words into a list of integers representing the lengths of the corresponding words.

Captura de pantalla 2017-02-13 a la(s) 10.23.32.png

Captura de pantalla 2017-02-13 a la(s) 10.23.52.png

15. Write a function find_longest_word() that takes a list of words and returns the length of the longest one.

Captura de pantalla 2017-02-13 a la(s) 10.35.34.png

Captura de pantalla 2017-02-13 a la(s) 10.36.14.png