(Simple) Dictionary Program in Python

This is a “reduced” lab experiment program to test and understand “Dictionary” Concept in python language.

This version of program is short and easy and focuses only on the dictionary concept in python.

myDictionary = {
    "morning": "time 4am to 9am",
    "night": "time 9pm to 3 pm",
    "hello": "greetings",
    "edu": "educoholic.com",
    "good": "to be desired or approved of",
    "best": "of the most excellent or desirable type or quality",
    "nature": "the basic or inherent features, character"
    }
def translate(w):
    w = w.lower()
    if w in myDictionary:
        print ("The meaning of the word", w, "is \n", myDictionary[w])
    else:
        print ("word is not in dictionary")

w = input("Enter your word")
translate(w)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.