how to mutate a tuple?

Diez B. Roggisch nospam-deets at web.de
Tue Oct 14 10:52:58 EDT 2003


> but is there a tuple=>list function ? so that instead of creating the list
> by a for-construct I could just say
> 
> list = tuple.tolist()
> list[0] = newval
> return turple(list)

foo = (1,2,3)
foo_list = list(foo)

Diez




More information about the Python-list mailing list