|
|
|
|
|
by matjet
1485 days ago
|
|
I do not see the use for this, over the standard access methods. people = {
"Diane": 70,
"Bob": 78,
"Emma": 84
}
people.get("Bob")
# 78
The common usecase is: for key in people.keys():
people.get(key)
vs keys = people.keys()
# dict_keys(['Diane', 'Bob', 'Emma'])
for key in keys:
keys.mapping[key]
What is the advantage? |
|
EDIT: apparently not:
In this case I actually don't know what the use case is :shrug: