LearnPy Hub
← File Handling problems
Medium

Number the Lines

Write n lines to a file, then print each line from the file prefixed with its number and a colon: 1: text.

Input

n, then n lines.

Output

n numbered lines.

Sample 1

Input
2
hello
world
Output
1: hello
2: world

Sample 2

Input
1
x
Output
1: x
solution.py
Output appears here
Number the Lines · Python practice problem · LearnPy Hub