пример файлаwords.txt:
Код: Выделить всё
apple
banana
orange
Код: Выделить всё
import random
with open('E:/Code/learn/Projects/word-guessing-game/words.txt', 'r') as file:
content = file.read()
words_list = content.split()
print(words_list)
Я новичок, поэтому буду рад любой помощи
Подробнее здесь: https://stackoverflow.com/questions/787 ... nipulation