Posts

Showing posts with the label python dictionary

Creating Custom French-to-English Dictionary in Python

dictFrench = { "je": "I", "chat": "cat", "chien": "dog", "cheval": "horse", "femme": "woman", "fille": "girl", "homme": "man", "avec": "with", "elle": "she", "garcon": "boy", "bonjour": "Good Morning!", "salut": "hi" } print("\nWelcome to the cute little French-to-English Dictionary!") print("\nThis dictionary contains the following French words.") for word in dictFrench.keys(): print(word) while True: french_word = input("\nInput any French word to know its english meaning: ") if french_word in dictFrench.keys(): print(f"\'{french_word}\' is French for \'{dictFrench[french_word]}\'.") e