title: Why loop is executing twice while writing to a file
body: <p>I have 2 files <code>abc.txt</code>, <code>cde.txt</code></p>
  <p>The content of abc.txt is &quot;This is abc file&quot;
  The content of cde.txt is &quot;This is cde file&quot;</p>
  <p>I am trying to write to a file. But the content writing twice
  Below is the code</p>
  <pre><code>in_files = ['abc.txt','cde.txt']
  out_files = ['abc_output.txt','cde_output.txt']
  read_dict = {}
  for file in in_files:
      with open(file,'r') as read_file:
          lines = read_file.readlines()
          read_dict[file] = lines
  read_dict
  for k,v in read_dict.items():
      for out in out_files: 
          with open(out,'w+') as write_file:
               for i in v:
                  print(i)
  </code></pre>
  <p>Output</p>
  <pre><code>This is abc file
  This is abc file
  This is cde file
  This is cde file
  </code></pre>
  <p>Expected</p>
  <pre><code>This is abc file
  This is cde file
  </code></pre>