How can I reverse only number and not the text from this ?
datas.txt
Bungo Charlie
Bungo Echo
Bungo Bravo
Bungo Tango
Bungo Alpha
with open('datas.txt', 'r') as f:
for i, line in enumerate(f):
print('{}. {}'.format(i+1, line.strip()))
Expectation:
5. Bungo Charlie
4. Bungo Echo
3. Bungo Bravo
2. Bungo Tango
1. Bungo Alpha
What I got :
1. Bungo Charlie
2. Bungo Echo
3. Bungo Bravo
4. Bungo Tango
5. Bungo Alpha