Last active
November 26, 2020 17:38
-
-
Save StuffbyYuki/fdf5d54f084b4df8d88bf38cf131b608 to your computer and use it in GitHub Desktop.
Python: Add comma at the end of your list or dict
This file contains hidden or 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
# Python accepts a comma at the end of your list/dict | |
# This is helpful when you define a list/dict vertically, helps you not forget to add a comma when adding a value | |
arr =[1, | |
2, | |
3,] | |
d = {1: 'a', | |
2: 'b', | |
3: 'c',} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment