Quick actions

cmd+k|ctrl+k

Navigation

Languages

Tuple

Snippet info

Language

Python

Visibility

public

Author

shigeotoga

Created

2026-08-05T10:46:49.50751Z

Updated

2026-08-05T10:46:49.50751Z

tuppy = (1,2,3,4,5,6,7,8)

print(tuppy)
print(tuppy.index(2), end="\n\n")

x, y, z, *other = tuppy
print(x)
print(other, end="\n\n")

x = 10 # Reassigns x, so does not change tuppy
print(x)
print(tuppy, end="\n\n")

tuppy = (x,2,3,4,5,6,7,8)
print(tuppy)
x = 5
print(tuppy) # Tuppy is unchanged, because it copies the value of x, not the pointer
INFO