2nd Semester Intro to Computer Science

Do Now 6.04

1. In your Console

Type the following

my_dictionary = {
'a': 1,
'b': 2,
'c': 3,
'd': 4,
'e': 5
}
print(list(my_dictionary))

In your Notebook

Respond to the following

  1. Write down what list() does when given a dictionary.
  2. What type does list() return?
  3. Write down how you might use a for loop to go through and print the values of my_dictionary.

2. In your Console

Challenge yourself

Try your solution to 3.

Edit this page Report an issue