number_file(src, dst) that copies src to dst, prefixing each line with its 1-based number, a colon and a space — 1: first line. Keep original line content otherwise untouched.number_file('poem.txt', 'numbered.txt') # poem: 'rose\nlily\n'numbered.txt: '1: rose\n2: lily\n'
Each line gains its position.
enumerate(f, start=1).
Write to the destination inside the same with statement.