Hi Craig,
Thanks for explain the code.
It work now, i just add integer to it.
line = int+2
HI I have another question would like to ask
How do i add a for loop and print each line from 1 to 10
1234567890 1234567891 1234567892
i wants to print like this
1 1234567890 1234567891 1234567892
2 1234567890 1234567891 1234567892
.............
10 1234567890 1234567891 1234567892
i just wants to add a range from 1 to 10, but i have no idea where to put the loop.
Thanks
Thanks for explain the code.
It work now, i just add integer to it.
line = int+2
HI I have another question would like to ask
How do i add a for loop and print each line from 1 to 10
with open('data.txt') as f,open('data_out.txt', 'w') as f_out: f_out.write(('===\t=========== \t =========== \t =========== \n').expandtabs(15)) for line in f: #the line variable is set to a string line = line.strip() f_out.write('{}'.format(line))right now it will print like this :
1234567890 1234567891 1234567892
i wants to print like this
1 1234567890 1234567891 1234567892
2 1234567890 1234567891 1234567892
.............
10 1234567890 1234567891 1234567892
i just wants to add a range from 1 to 10, but i have no idea where to put the loop.
Thanks