Dictionaries Flashcards
1
Q
What can be keys in python dictionaries
A
number, string, tuples (if they are strictly one data type)
2
Q
How to get a list of all the keys in a dictionary?
A
list(d)
3
Q
deleting a key
A
del d[key]
4
Q
checking if a key exists
A
key in d
5
Q
adding a key pair value
A
d[key] = value