Python line.replace multiple strings
<p>I am replacing the '2010' with a random number:</p>

<pre><code>from random import randint
with open("data.json", "rt") as fin:
    with open("dataout.json", "wt") as fout:
        for line in fin:
            fout.write(line.replace('2010', str(randint(1990, 2007))))
</code></pre>

<p>how can I replace two items in one code, that is:</p>

<pre><code>fout.write(line.replace('2099', str(randint(1800, 1900))))
fout.write(line.replace('2010', str(randint(1990, 2007))))
</code></pre>