Build a List
Completed
Read n, then n lines each containing a word. Collect the words with append and print the list.
Input
Line 1: n. Then n words.
Output
The list, as Python prints it.
Example
Input
3 apple banana cherry
Output
['apple', 'banana', 'cherry']
Editor
Python
Hints
Start with an empty list: words = [].
_ is the conventional name for a loop variable you don't use.
Solution explanation
Printing a list shows its Python representation, with brackets and quotes.
Show solution
n = int(input())
words = []
for _ in range(n):
words.append(input())
print(words)