0

I am trying to use a loop to write randomly generated numbers to a text document. Then, using a different program, I need to use a loop to read the numbers. The first program needs to output the numbers in the SAME LINE, the second program needs to output them in DIFFERENT LINES (their own, one per line) Here is what I have:

**The write one works, I can't get the read one to become a float.

for the first program (write)

```
import random
def main():
one = 1
thirteen = 13
subtract = 1
number_gen = open('numbers.txt', 'w')
for number in range(one,thirteen,subtract):
numbers = random.randit(1,100)
number_gen.write(str(numbers + ' ')
number_gen.close()
main()
```

For the second program (read)

```
def main():
numbers_read = open('numbers.txt', 'r')
for line in numbers_read:
amount = float(line)
print(format(amount, '.2f'))
numbers_read.close()
main()
```