Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save StuffbyYuki/fdf5d54f084b4df8d88bf38cf131b608 to your computer and use it in GitHub Desktop.
Save StuffbyYuki/fdf5d54f084b4df8d88bf38cf131b608 to your computer and use it in GitHub Desktop.
Python: Add comma at the end of your list or dict
# 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