#Dictionary practice

def menu():
    print("1. Add name and number")
    print("2. Print the directory")
    print("3. Quit")

options = 0
directory = {}

while options < 3 :
    menu()
    options = int(input("Enter your desired option :"))
    if options == 1 :
        print("You selected to add name and number")
        name = input("Enter name :")
        number = input("Enter number :")
        directory[name] = number
    elif options == 2 :
        print("Directory")
        for x in directory.Keys() :
            print("Name :",x,"\tDirectory:",directory[x])
    else :
        if options == 3 :
            print("Quiting .......")

This is a program I created but I am having trouble printing my directory please anyone help me with this

Edited 4 Years Ago by SnHnBoLt: spelling mistakes

Take out .Keys()(it is .keys() but it is default for iteration)
Variable name number is not logical for string.

Edited 4 Years Ago by pyTony

Comments
Thank you very much.It works fine after lowering the case of keys. :-)
This question has already been answered. Start a new discussion instead.