Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Create a Tuple

 pythonCopy>>> x = (3, 'pink', 3+8j)
>>> print('x[0] =', x[0])
x[0] = 3
>>> print('x[0:2] =', x[0:2])
x[0:2] = (3, 'pink')
>>> x[0] = 4
TypeError: 'tuple' object does not support item assignment
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #Create #Tuple
ADD COMMENT
Topic
Name
5+5 =