Tiny-Python-3.9-Notebook
Tiny-Python-3.9-Notebook copied to clipboard
Dictionary and looping
Would the following change the existing code be more efficient?
>>> for name in instruments.keys():
... print('{} - {}'.format(name,
... instruments[name]))
Or
>>> for name, instrument in instruments.items():
... print('{} - {}'.format(name,
... instrument))