Data Types - Dictionary Flashcards

1
Q

Can Dictionaries be sliced, and why?

A

No - Python is simply not programmed to support it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

person = {“name”: “Alice”, “age”: 30}

Give 2 ways to remove “age” from this dictionary

A

del person[“age”]

person.pop(“age”)

.remove() is a method of List

How well did you know this?
1
Not at all
2
3
4
5
Perfectly