# List to Dict

Convert lists into dicts using just one line of code. 

This trick is useful on a real project with Django and Machine learning for example. 

```python
fruits = ["mango", "banana", "apple"]

price = [10, 5, 4]

new_dict = dict(zip(fruits, price))
```

You can learn more about the `zip` function [here](https://docs.python.org/3.3/library/functions.html).

*Article posted using [bloggu.io](https://bloggu.io). Try it for free.*
