Answer the question
In order to leave comments, you need to log in
How to parse a simple set of words line by line into a list?
There is a dictionary in the form of a simple list of words in a text document. It is necessary to make a list from this set of words.
Example:
Yes:
names.txt
Андрей
Евгений
Иван
Сергей
names = [Андрей, Евгений, Иван, Сергей]
Answer the question
In order to leave comments, you need to log in
I found a crooked way.
one)
names = ['''
Андрей
Евгений
Иван
Сергей
''']
print (names)
a = "Андрей\nЕвгений\nИван\nСергей\n"
print(a)
print (a.splitlines())
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question