0
How 2 can be replaced with 3 here?
Python tuples https://code.sololearn.com/c4Z4EZkWEx88/?ref=app
8 odpowiedzi
+ 4
alagammai uma
First convert tuple to list then assign value and again change to tuple
mixtuple=(['a',1,True],2,'Science',-5)
y = list(mixtuple)
y [1] = 3
x = tuple(y)
print (x)
+ 10
Bro you named it tuple still you r asking this question
Don't u know tuple is IMMUTABLE !!
+ 2
alagammai uma
Your question and code both are unclear and incomplete.
+ 1
A͢J thank you
+ 1
mixtuple=([‘a’,1,True],2,’Science’,-5)
y=list(mixtuple)
y[1]=3
x=tuple(y)
Print(x)
0
The element 2 is to be replaced as 3
0
Sriraam SK thank you
- 2
Swati tuple containing list can be changed