[Tutor] Critique of program

Jeff Shannon jeff at ccvcorp.com
Thu Nov 18 19:58:37 CET 2004


Bill Burns wrote:

>Like you mention, I might need to split this into four pieces. I'm sure I will
>if I use a dict as many of the keys would be the same. Every type of pipe
>has a 1/2", 3/4", 1", etc.
>  
>

Well, you could always key the dictionary with a tuple of (type, size).  
That should give you unique keys for each entry, right?  And if you need 
to iterate through, instead of doing random lookups, they keys() list 
should sort (and filter) nicely...

Jeff Shannon
Technician/Programmer
Credit International




More information about the Tutor mailing list