LearnPy Hub
← File Handling problems
Easy

readlines() as a List

Read n and n words. Write each word on its own line to w.txt. Then read the file with readlines(), strip each line and print the list.

Input

n, then n lines.

Output

A Python list.

Sample 1

Input
3
a
b
c
Output
['a', 'b', 'c']

Sample 2

Input
1
hello
Output
['hello']
solution.py
Output appears here
readlines() as a List · Python practice problem · LearnPy Hub