Python mange with liste

Rustom Mody rustompmody at gmail.com
Sat Dec 28 22:52:17 EST 2013


On Sun, Dec 29, 2013 at 8:38 AM, Rustom Mody wrote:
> Give up on file-IO, ie dont use the EXTERNAL file
>
> nam1;F;Y
> nam2;M;N
> nam3;F;Y
> nam4;M;N
> halo;M;Y
> rock;M;N
> nam1;F;N
>
> But ASSUME you have the internal python data structure
> names = [("nam1", "F", "Y"), ("nam2", "M", "N")] # complete the list

Well it may be better to write that as
names = [("nam1", "F", True), ("nam2", "M", False), etc]

ie represent Y by boolean True rather than the string "Y" etc

though you could get bitten by the fact that python booleans are
strange in that True is True but all kinds of things are True-ish



More information about the Python-list mailing list