constructors for lists and tuples
janko hauser
jhauser at ifm.uni-kiel.de
Tue Dec 11 09:03:07 EST 2001
More information about the Python-list mailing list
Tue Dec 11 09:03:07 EST 2001
- Previous message (by thread): constructors for lists and tuples
- Next message (by thread): constructors for lists and tuples
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
one can not define empty list/tuples with a predefined length. it is possible to create a sequence of a given length by multiplying a one element sequence. >>> a=(1,)*3 >>> a (1, 1, 1) This is slighly more economic than appending or inserting to an empty list. >>> a=[] >>> a.append(1) >>> a [1] HTH, __Janko
- Previous message (by thread): constructors for lists and tuples
- Next message (by thread): constructors for lists and tuples
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list