converting tuple to list

Adrian Eyre a.eyre at optichrome.com
Thu Jan 13 08:56:11 EST 2000


> list(sequence) -> yields a list with the same entries as sequence
> tuple(sequence) -> yields a tuple, likewise

Just out of interest: what is the canonical way of converting a list
of tuples to a dictionary? i.e. the opposite of dict.items()

e.g.

[("key1","value1"),("key2","value2")] -> {"key1":"value1","key2":"value2"}





More information about the Python-list mailing list