Hi Ros,
 
I placed two new lines of code in your choices 2 and 7. The new lines have comments trailing them.
 
In choice 7, you forgot to delete the previous father_son pair (as you had done in choice 5).
 
Regards,
Charles
 
#######
 
 
    # list all fathers
    elif choice == "2":
        print "LIST OF ALL FATHERS\n"
        print father_son.keys()            # print fathers - their the keys
        
    # replace a father-son pair
    elif choice == "7":
        term = raw_input("Type in the name of the father which corresponds \
        to the father-son pair you want to replace: ")
        if term in father_son:
            del father_son[term]                        # delete previous father_son pair
            term = raw_input("Type in name of this 'replacement' father: ")
            definition = raw_input("Type in the name of this person's son: ")
            father_son[term] = definition
            print "A new father-son pair has been added.", term, "is the \
            father of", definition
    else:
        print "\nSorry, but", choice, "isn't a valid choice."
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to