constucting a lookup table

johnzenger at gmail.com johnzenger at gmail.com
Tue May 16 11:01:01 EDT 2006


How about a dictionary, keyed on tuples of (height, weight)?

mhodkin at comcast.net wrote:
> I'm new to Python and want to contruct a "lookup table" which would be
> similar to a spreadsheet in that a value is read along the first
> column, then along the top row, and the intersection of the two gives a
> value that is hard-coded, i.e. not mathmatically related.  An example
> would be a table with HEIGHT in the first column, WEIGHT in the first
> row, and estimated SUITSIZE with the body of the table.
>
> Which Python type would be most appropriate and/or efficient?
> 
> thanks




More information about the Python-list mailing list