Here's my code:
from random import random
f = open('Attractors1.txt', 'w')
for i in range(10):
theta = (3.14/2)*random()
f.write(str(theta))
I'm trying to create a list of 10 theta values so I can call them in another program, but I don't think the objects are writing correctly. How do I know if I'm doing it write? Whenever I run the code and execute f.read() I get an error saying the file isn't open.