How do I convert a list to a string in Python? : <p>I would like to convert the result of the following:</p>

<pre><code>def main():
    list = open('friends.txt').readlines()
    list.sort()
    f = open('friends_sorted.txt', 'w+')
    f.write(str(list))
    f.close()

if __name__ == '__main__':
    main()
</code></pre>

<p>from</p>

<p>['David\n', 'Geri\n', 'Jessica\n', 'Joe\n', 'John\n', 'Rose\n']</p>

<p>to</p>

<p>David
<br>Geri
<br>Jessica
<br>Joe
<br>John
<br>Rose</p>

<p>--</p>

<p>How would I do this?</p>
