title: Python Append Txt.file
body: <p>I'm working on a python script that I will get all inactive users and list it on a txt file. I have append it on a txt.file however it seems &quot;\n&quot; does not give me proper results that I need.</p>
  <p>This is my code.</p>
  <pre><code>with open('InactiveUsersList', 'w') as f:
                      inactiveUser = (str(userDetail.get(&quot;firstName&quot;)) + &quot; &quot; + str(userDetail.get(&quot;lastName&quot;)) +&quot;: User is not Active&quot;)
                      print(inactiveUser)
                      print(&quot;----------------------------------&quot;)
                      for i in inactiveUser:
                          f.write(i + '\n')
                  f.close()
  </code></pre>
  <p>The output that I'm expecting should be like this:</p>
  <pre><code>LastName FirstName: User is not Active
  LastName2 FirstName2: User is not Active
  </code></pre>
  <p>But instead, I'm having this result.</p>
  <pre><code>L
  a
  s
  t
  N
  a
  m
  e
   
  F
  i
  r
  s
  t
  N
  a
  m
  e
  :
  U
  s
  e
  r
  i
  s
  n
  o
  t
  A
  c
  t
  i
  v
  e
  </code></pre>
  <p>Thanks for your help everyone :)</p>