Sorry, everybody. I am still having problems with this script - tho' it now runs correctly nearly to the end!
Here is the whole script: #! /usr/bin/python # create an empty address book dictionary AddressBook = {} # read entries till an empty string print name = raw_input("Type the Name - leave blank to finish") while name != "": entry = raw_input("Type the Street, Town, Phone. Leave blank to finish") AddressBook[name] = entry name = raw_input("Type the Name - leave blank to finish") # now ask for one to display name = raw_input("Which name to display?(blank to finish)") while name !="": print name, AddressBook[name] name = raw_input("Which name to display?(blank to finish)") I started with: lisi@Tux:/usr/local/bin$ AddressBook Type the Name - leave blank to finishLisi Type the Street, Town, Phone. Leave blank to finishth, rc, 123457 Type the Name - leave blank to finish Which name to display?(blank to finish) Lisi Lisi Traceback (most recent call last): File "/usr/local/bin/AddressBook", line 17, in <module> print name, AddressBook[name] KeyError: ' Lisi' I have tried various other words besides Lisi, each one less probable than its predecessor. I am getting nowhere. The error may well be somewhere else again, but I can't see where. :-( Lisi _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor