If this is the input:
a
b
c
I want to have this:
1 a
2 b
3 c
I have this code:
but my row number begins in 0
a
b
c
I want to have this:
1 a
2 b
3 c
I have this code:
Code:
infile=open('resultado.txt','r')
lines=infile.readlines()
infile.close()
outtext=['%d %s' % (i,line) for i, line in enumerate(lines)]
outfile = open ('res.txt','w')
outfile.write(str(''.join(outtext)))
outfile.close()
Comment