3/15/2022

TypeError: ‘tuple’ object does not support item assignment

 

Here is simple solution


..

x = (1,2,3)
y = list(x) #convert tuple -> list
y[0] = 10 #modify element value
x = tuple(y) #revert list -> tuple
print(x)

..


Thank you.

www.marearts.com

πŸ™‡πŸ»‍♂️

No comments:

Post a Comment