Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Tuple: Tuple cannot change

# tuple cannot be changed

my_list =  [3, 4, 5]
my_tuple = (3, 4, 5)

my_list[0] =  9
my_tuple[0] = 9 # TypeError: 'tuple' object does not support item assignment

print(my_list)
print(my_tuple)
Source by xahlee.info #
 
PREVIOUS NEXT
Tagged: #Tuple #change
ADD COMMENT
Topic
Name
4+1 =