I would like to ask how do I open two files with data inside and subtract them then store them into a file ?
with open("bignum.txt","r") as f:
score=f.read()
score_ints =[int(x) for x in score.split()]
with open("smallnum.txt","r")as d:
score_y = d.read()
score_y_ints =[int(x) for x in score_y.split()]
difference = [x - y for x, y in zip(score_ints, score_y_ints) ]
smallnum.txt
10000
120
bignum.txt 99 2220
Expected outcome : 9901 -2100
so this is my previous code . It will output it as list but this isn't what I wanted.