LearnPy Hub
← File Handling problems
Easy

Length of Every Line

Write the input lines (n of them) to lines.txt. Then loop over the file object directly and print the length of each line without its newline.

Input

n, then n lines.

Output

n lines.

Sample 1

Input
3
ab
c
xyz
Output
2
1
3

Sample 2

Input
1
hello
Output
5
solution.py
Output appears here
Length of Every Line · Python practice problem · LearnPy Hub