replacing a word in a string based on the content of the file in Python
<p>I have a text file with the following line - <code>a boy is drinking water</code>. say i call this file A.txt</p>

<p>My objective is to replace the word <code>water</code>  with anything the user gives as input in A.txt.
and retaining the other stuff intact.
If A.txt is changed to <code>a boy is drinking juice</code> and is passed A.txt as parameter to the Python script, I want the output to be <code>a boy is drinking juice</code>. </p>

<p>How can we replace only that particular letter in a string.</p>

<p>thanks in advance for helping.</p>
