Cleaning up conditionals
greg.ewing at canterbury.ac.nz
Mon Jan 2 18:27:53 EST 2017
Deborah Swanson wrote:
> flds = len(ls)
> cl, ur, d1, de, lo, st, mi, ki, re, da, br, no, yn, ma, ar =
You might like to consider converting the row into a
namedtuple, then you could refer to the fields using
attribute names instead of indexes.
You could even use the header row to set up the field
names in the namedtuple, so if you reorder the columns
in the file, the code would automatically adapt.
More information about the Python-list