xxxxxxxxxx
with open('input.txt', 'r') as f:
lines = f.readlines()
measurements = [int(entry.strip()) for entry in lines]
xxxxxxxxxx
myfile = open("example.txt")
txt = myfile.read()
print(txt)
myfile.close()
xxxxxxxxxx
with open('readme.txt') as f:
lines = f.readlines()
Code language: Python (python)