Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save traderbagel/a40b9afea004d8ae202502c14416cda0 to your computer and use it in GitHub Desktop.
Save traderbagel/a40b9afea004d8ae202502c14416cda0 to your computer and use it in GitHub Desktop.
Contruct a tuple with only one elements
# tuple
single_tuple = (1,)
# integer
# Python thinks it's part of a mathematical operation and has precedence
not_tuple = (1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment