I have python code which is producing following output,

```
[

['3', 'cs2313', 'someone', 'cs231', 'IT networks', 'cs232', 'IT Workshop', 'cs233', 'IT programming'], 
['5', 'ec3325', 'someone', 'ec301', 'Maths2', 'ec302', 'Theory of Circuits', 'ec303', 'PCB design'], 
['7', 'cs4890', 'someone', 'cs401', 'Game Theory', 'cs402', 'Systems Programming', 'cs403', 'Automata'],
['1', 'ec1008', 'someone', 'ec101', 'Digitization', 'ec102', 'Analog cicuit design', 'ec103', 'IP Telephony'], 
['3', 'cs2002', 'someone', 'cs231', 'IT networks', 'cs232', 'IT Workshop', 'cs233', 'IT programming'], 
['3', 'cs2009', 'someone', 'cs231', 'IT networks', 'cs232', 'IT Workshop', 'cs233', 'IT programming']

]

```

I am writing this in file 

```
fo=open("result.txt","w")
print ("Name of file: ",fo.name)
for item in x :
    fo.write("%s\n"% item)
fo.close()

```

The list goes as above mentioned.
But what I want the output in file is 

```
 [

    '3', 'cs2313', 'someone', 'cs231', 'IT networks', 'cs232', 'IT Workshop', 'cs233', 'IT programming', 
    '5', 'ec3325', 'someone', 'ec301', 'Maths2', 'ec302', 'Theory of Circuits', 'ec303', 'PCB design', 
    '7', 'cs4890', 'someone', 'cs401', 'Game Theory', 'cs402', 'Systems Programming', 'cs403', 'Automata',
    '1', 'ec1008', 'someone', 'ec101', 'Digitization', 'ec102', 'Analog cicuit design', 'ec103', 'IP Telephony', 
    '3', 'cs2002', 'someone', 'cs231', 'IT networks', 'cs232', 'IT Workshop', 'cs233', 'IT programming', 
    '3', 'cs2009', 'someone', 'cs231', 'IT networks', 'cs232', 'IT Workshop', 'cs233', 'IT programming'

    ]

```

meaning each output line separated by a new line.Is there a function call for the same or a better way than what I have written do get the result.