list or dictionary

Chris Angelico rosuav at gmail.com
Tue Sep 20 17:01:39 EDT 2016


On Wed, Sep 21, 2016 at 4:04 AM, Ganesh Pal <ganesh1pal at gmail.com> wrote:
> 1. store it in list and grep for id and return
> 2. store it in dict as key and value i.e hostname = { 'hostname1': 1} and
> return key
> 3. any other simple options.

4. Store it in dict, but the other way around. The key should be the
thing you want to look up; the value, the thing you want to find out.

ChrisA



More information about the Python-list mailing list