05 | Dictionaries
Dictionaries
- Which of the following is correct code for a dictionary? 1, 2, or 3?
menu = ["iced coffee": 3, "espresso": 2.5, "latte": 4.2]
menu = {"iced coffee": 3, "espresso": 2.5, "latte": 4.2}
menu = ("iced coffee": 3, "espresso": 2.5, "latte": 4.2)
- What are the terms for the pairs in a dictionary ?
- How would you access the value of
"iced coffee?'
- What does the
list()
function do? - Are dictionaries indexed and/or ordered?