py: read file to list

with open ('input.txt', 'r') as file:
    text=file.read().splitlines()
    # text=file.readlines()
print (text[0])

Last updated

Was this helpful?