[Tutor] dict['_find']

2011-02-19 Thread Max Niederhofer
Hello all, first post, please be gentle. I'm having serious trouble finding an alternative for the deprecated find module for dictionaries. The code (from Zed Shaw's Hard Way, exercise 40) goes something like this. Hope indentation survives. cities = {'CA': 'San Francisco', 'MI': 'Detroit', 'FL'

Re: [Tutor] dict['_find']

2011-02-20 Thread Max Niederhofer
;State? (ENTER to quit)", state = raw_input ("> ") if not state: break city_found = cities['_find'](cities, state) print city_found Thanks for your help, especially the comments about keeping things separate and explicit.