Re: list to tuple

2005-08-11 Thread Ruslan Spivak
"zxo102" <[EMAIL PROTECTED]> writes: > Hi, >I got several dynamic lists a1, b1, c1, from a python > application such as >a1 = [1,5,3,2,5,...], the len(a1) varies. Same to b1, c1, > >With python, I would like to reorganize them into a tuple like > >t1 = ((a1[0],b1[0],c1[0]

Re: default value for list access?

2005-02-27 Thread Ruslan Spivak
Ð ÐÑÐ, 27/02/2005 Ð 14:03 -0600, Bo Peng ÐÐÑÐÑ: > To clearify the problem: > > The data is the count of something, for example a[90]=10. a may be a > dictionary if the range is huge and a list when the range is reasonably > small. In the dictionary case, I can use a.setdefault(80, 0) if key 80