\(\renewcommand\AA{\unicode{x212B}}\)

Basic Python Exercises

Exercise 3

  • Starting with your solution to exercise 2, rewrite your code so that you have a function called fib that accepts a number. The function should compute a fibonacci sequence containing this many elements and return them as a list.

Exercise 4

  • Write a program that creates a dictionary and initializes it with 5 names/ID pairs.

    • Create a function that prints out the dictionary as a 2 columns: the first being the key and the second the value

    • Update the dictionary with another 5 name/values and reprint the table, making sure you understand the ordering within the map