Dictionaries in Python
<p>I have a text file indicating the frequencies like 
"read 1 dick 1 john 1 book 1
read 1 different 1 a 1 different 1
"
i also have a dictionary defined for these words dict={'a':1,'book':2}</p>

<p>I would like to replace the words by their dictionary values. Could anyone let me know how is this done ? </p>
