To make changes so it work,and some improvent.
Some points need
when use
Some points need
w
parameter when shall wtite to file.when use
with open
don't need to close
the file as it automatically done.name = 'Tom' sipCard = 5 twoforone = 3 #monthly record with open("MonthlyRecord.txt", 'w') as fp_out: fp_out.write(f'{name}\n{sipCard}\n{twoforone}') with open("MonthlyRecord.txt", "r") as fp: print(fp.read())
Output:Tom
5
3