Przeczytaj wszystkie wiersze jako listę w pliku za pomocą funkcji ReadLines ()

# Program to read all the lines as a list in a file
#  using readlines() function

file = open("python.txt", "r")
content=file.readlines()
print(content)
file.close()

Gorgeous Gazelle