Skip to content

Instantly share code, notes, and snippets.

@thetongs
Created January 20, 2022 12:54
Show Gist options
  • Save thetongs/f42f5b244e694f3380b3bc1dab29d9d7 to your computer and use it in GitHub Desktop.
Save thetongs/f42f5b244e694f3380b3bc1dab29d9d7 to your computer and use it in GitHub Desktop.
# Tuple
var_tuple = (1, 2, 3, 4, 5)
print(var_tuple)
print(type(var_tuple))
# (1, 2, 3, 4, 5)
# <class 'tuple'>
var_tuple = (1, "Hello")
print(var_tuple)
# (1, 'Hello')
var_tuple[0] = 2
print(var_tuple)
# TypeError: 'tuple' object does not support item assignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment