En este post vamos a hacer los primeros 5 ejercicios de  46, son diferentes tipos de ejercicios en los cuales vamos a desarrollar diferentes habilidades.

  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.)

    Captura de pantalla 2017-03-30 a las 10.42.45Resultados:Captura de pantalla 2017-03-30 a las 10.42.22

  2. Define a function max_of_three() that takes three numbers as arguments and returns the largest of them.

    Captura de pantalla 2017-03-30 a las 10.34.21Resultados:Captura de pantalla 2017-03-30 a las 10.39.22

  3. Define a function that computes the length of a given list or string. (It is true that Python has the len() function built in, but writing it yourself is nevertheless a good exercise.)

    Captura de pantalla 2017-03-30 a las 10.38.53

  4. Write a function that takes a character (i.e. a string of length 1) and returns True if it is a vowel, False otherwise.
  5. Write a function translate() that will translate a text into «rövarspråket» (Swedish for «robber’s language»). That is, double every consonant and place an occurrence of "o" in between. For example, translate("this is fun") should return the string "tothohisos isos fofunon".