default value in a list

TB tbolands at yahoo.com
Fri Jan 21 18:14:23 EST 2005


Hi,

Is there an elegant way to assign to a list from a list of unknown
size?  For example, how could you do something like:

>>>  a, b, c = (line.split(':'))
if line could have less than three fields?

Thanks,
TB




More information about the Python-list mailing list