Skip to content

Instantly share code, notes, and snippets.

@vereperrot
Created December 19, 2019 09:03
Show Gist options
  • Save vereperrot/b7d6ab0d42c9840069d3e066ac443cc2 to your computer and use it in GitHub Desktop.
Save vereperrot/b7d6ab0d42c9840069d3e066ac443cc2 to your computer and use it in GitHub Desktop.
print list
# 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