mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 15:00:18 +00:00
6 lines
206 B
Python
6 lines
206 B
Python
line_number = 1
|
|
with open('examples/favorite-people.txt', encoding='utf-8') as a_file:
|
|
for a_line in a_file:
|
|
print('{:>4} {}'.format(line_number, a_line.rstrip()))
|
|
line_number += 1
|