Building a dictionary from a tuple of variable length

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Mon Mar 5 03:55:08 EST 2007


In <1173084222.565386.250510 at h3g2000cwc.googlegroups.com>, bg_ie wrote:

> Therefore, how do I build the tuple of Falses to reflect the length of
> my t tuple?

In [1]: dict.fromkeys(('one', 'two', 'three'), False)
Out[1]: {'three': False, 'two': False, 'one': False}

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list