Created
December 19, 2019 09:03
-
-
Save vereperrot/b7d6ab0d42c9840069d3e066ac443cc2 to your computer and use it in GitHub Desktop.
print list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/4440516/in-python-is-there-an-elegant-way-to-print-a-list-in-a-custom-format-without-ex | |
lst = [[1, 2],[ 3,4]] | |
>>> print('\n'.join('{}: {}'.format(*k) for k in enumerate(lst))) | |
0: [1, 2] | |
1: [ 3,4] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment