+ 1
So once a tuple is created with some values can it be extended?
4 Réponses
+ 4
Nope. Tuples are immutable. That means that after creating you can't change them anymore.
+ 1
The only way to change a value in a tuple is to create a new tuple with the new value(s)
+ 1
You cannot change a tuple because they are immutable but you can append it.
0
tup=(1,2,3)
tup+=(4,)
print (tup)
#(1,2,3,4)