python&tensorflow&pytorch

tuple 내부의 값은 바꿀 수 없다.

tomato13 2011. 1. 19. 19:48

tuple 내부의 값은 바꿀 수 없다.


ex)

def test13():

a = (1, 2, 3)

a[1] = 2


=> 

TypeError: 'tuple' object does not support item assignment