Removing all occurences of a character from a string.

John Hunter jdhunter at ace.bsd.uchicago.edu
Wed Sep 25 10:53:30 EDT 2002


>From the example you gave, I was wondering if a dictionary might be a
more suitable data structure:

attr = { "gill-attachment" : ["a", "d", "f", "n"], 
         "gill-spacing"    : ["c", "d", "w"],
         "gill-size"       : ["b", "n"]
         }

print attr["gill-size"]

John Hunter




More information about the Python-list mailing list