I am trying to write a program that will create files, one file should look like this:
1
19
next file
2
18
3
17
etc...
and so until the 19 is on the first line and 1 is on the second line, pretty much i am incrementing firs line from 1 to 19 and decrementing second line from 19 to 1. I have this code which creates the file and writes the first number but not the last, any suggestions please?
for x in range(1,19):
file = open("test%x"%x, 'w')
file.write('%x'%x)
for x in range(19,1):
file = open("test%x"%x, 'a')
file.write('%x'%x)
file.close()