converting a list into a tuple?

Oleg Broytmann phd at phd.fep.ru
Thu May 24 06:36:29 EDT 2001


On Thu, 24 May 2001, Harvest T. Moon wrote:
> how do i convert
>
> mylist = ["foo", "bar"]
>
> into
>
> mytuple = ("foo", "bar")

   return tuple(mylist)

Oleg.
----
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list