---
title: "Dictionary with python"  
description: "Dictionary with python"  
author: "Anonymous User"  
published: 2018-06-29  
updated: 2018-06-29  
canonical: https://www.mindstick.com/forum/34562/dictionary-with-python  
category: "python"  
tags: ["python-3.4"]  
reading_time: 1 minute  

---

# Dictionary with python

How to implement [Dictionary](https://www.mindstick.com/articles/1500/hashtable-and-dictionary-in-c-sharp) with Python3?

## Replies

### Reply by Prakash nidhi Verma

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.

Example:

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]
```

![Dictionary with python](https://www.mindstick.com/mindstickforums/807e7832-7a36-4193-b2c5-30cc11c41d5f/images/35bafc59-f3f7-4abf-9f20-c42a5095aeb9.png)

![Dictionary with python](https://www.mindstick.com/mindstickforums/807e7832-7a36-4193-b2c5-30cc11c41d5f/images/32c4498d-ef62-45fb-9b68-bc46e4587ee5.png)\


---

Original Source: https://www.mindstick.com/forum/34562/dictionary-with-python

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
