how to add value to a tuple?

后端 未结 8 1711
别那么骄傲
别那么骄傲 2020-12-08 03:43

I\'m working on a script where I have a list of tuples like (\'1\',\'2\',\'3\',\'4\'). e.g.:

list = [(\'1\',\'2\',\'3\',\'4\'),
        (\'2\',\         


        
8条回答
  •  孤城傲影
    2020-12-08 04:21

    In Python, you can't. Tuples are immutable.

    On the containing list, you could replace tuple ('1', '2', '3', '4') with a different ('1', '2', '3', '4', '1234') tuple though.

提交回复
热议问题