Starting with creating our data file data.txt
:
12
54
7
332
54
1
0
We have changed just one line so that it now has * 10
rather than + 17
:
with open("data.txt") as f:
for line in f:
number = int(line)
new_number = number * 10
print(new_number)
python file.py