Open
Description
Hi,
I think, you should use the f-strings for your examples:
for example:
print('{} - {}'.format(name,
... instruments[name]))
should be written
print(f"{name} - {instruments[name]}")
or better with Python 3.8 (f-strings now support '=', see https://bugs.python.org/issue36817)
print(f"{name=} - {instruments[name]=}")
Thanks for your work. Have a nice day !
f-strings pointers
- https://www.python.org/dev/peps/pep-0498/ (Python 3.6)
- https://bugs.python.org/issue36817 (Python 3.8)
- https://speakerdeck.com/willingc/the-state-of-python?slide=22
- https://deepsource.io/blog/python-3-8-whats-new/
- https://morioh.com/p/c3adfa91ad7c/awesome-new-python-3-8-features
- https://realpython.com/python-f-strings/
- https://twitter.com/fperez_org/status/829856890536419329
- https://cito.github.io/blog/f-strings/
Metadata
Metadata
Assignees
Labels
No labels