Are Tuples In Python Mutable

[Solved] Are Tuples In Python Mutable | Perl - Code Explorer | yomemimo.com
Question : are tuples mutable

Answered by : chidera-ugochukwu

# Trying to change their values results in an error.
tup = (10, "20", 20, 30, "Thirty-five", 50)
tup[0] = 1# Trying to change the first value of the tuple to 1. This raises an error.
# Tuple object does not support assigment.

Source : | Last Update : Wed, 21 Sep 22

Question : are tuples in python mutable

Answered by : filthy-ferret-dc8rctnxx72r

>>> dum = ('1861-10-23', ['poetry', 'pretend-fight'])
>>> dee = ('1861-10-23', ['poetry', 'pretend-fight'])
>>> dum == dee
True
>>> dum is dee
False
>>> id(dum), id(dee)
(4313018120, 4312991048)

Source : http://radar.oreilly.com/2014/10/python-tuples-immutable-but-potentially-changing.html | Last Update : Thu, 20 Aug 20

Answers related to are tuples in python mutable

Code Explorer Popular Question For Perl