Answer:
//We need to sum various numbers using a python program, and then store the numbers in a text file.
def sumnum():
file2 = open("numbers2.txt","w")
i=5
while i != 0:
number=input("Enter the no.")
file2.write(number)
file2.write("\n")
i = i -1
file2.close()
file=open("numbers2.txt", "r+")
number = 0
sum2 = 0
for number in file:
sum2 =sum2 + int(number)
print(sum2)
file2.close()
sumnum()
Explanation:
Please check the answer section.