Dictionary with python

Total Post:7


 851  View(s)
Rate this:

How to implement Dictionary with Python3?

  1. Re: Dictionary with python

    This program uses python like a container it's called dictionary which is in dictionary a key is associated with some information. This program will take a word as input and returns the meaning of that word. 


    data = {"mindstick" : "engage in software development and open source for question answer portal."} 

    // Python3 Code for implementing 

    // dictionary

    // importing json library

    import json

      // importing get_close_matches fuction from difflib library 

    from difflib import get_close_matches

    // loading data

    data = json.load(open("data.txt"))

    // defining function meaning

    def meaning(w):
    // converting all the letters of "w" to lower case
    w = w.lower()

    // checking if "w" is in data 

        if w in data:
            return data[w]



Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.