Dictionary checking
Bjørn Ove Grøtan
bgrotan at stud.ntnu.no
Sat May 25 13:45:40 EDT 2002
I'm building a dictionary with values from a file.
for each key, I have an ID, Name and Alias
for some keys I have only ID and Name, some keys with
ID and Alias, some keys with all 3 and a few keys
with only a ID with no Name and no Alias.
How can I check if Name and/or Alias contain anything.
If Name contains any string it's ok, but if not I want to
use the string value of Alias - and if not any value (space/blank)
of Alias I want to do some error-handling.
Also, I want to make some output with data combined from 2 dictionaries.
Does anyone have any examples on how to do this?
Bjørn Grøtan
More information about the Python-list
mailing list