268 'update': 'can_update',
269 'delete': 'can_delete',
270 }
271 if operation not in list(operations.keys()):272 raise ValueError('No such operation defined')
273
274 try:
Consider iterating the dictionary directly instead of calling .keys()
.
Using for key in dictionary
would always iterate the dictionary keys.
sounds = {"cow": "moo", "dog": "bark"}
for key in sounds.keys():
print(key)
sounds = {"cow": "moo", "dog": "bark"}
for key in sounds:
print(key)