LearnPy Hub
← File Handling problems
Easy

Print With Line Numbers

Read n and n lines and write them to poem.txt. Read the file back and print each line as N: text, numbering from 1.

Input

n, then n lines.

Output

n lines.

Sample 1

Input
2
Roses are red
Violets are blue
Output
1: Roses are red
2: Violets are blue

Sample 2

Input
1
hello
Output
1: hello
solution.py
Output appears here
Print With Line Numbers · Python practice problem · LearnPy Hub