Answer:
The program to this question can be described as follows:
Program:
def sum(): #defining the method main
f = open('numbers.txt','r') #open the file in r mode
total = 0#Initialize variable total to 0
for i in f: #defining a loop to calculate total of the number
num = int(i) #holding value of file in num variable
total =total+ num # adding the value in total variable
f.close() # close the file
print('Total of the number is: ',total) #print total
sum() #calling the method
Explanation:
In the question it is declared that a file "numbers.txt" is declared, that contain the number so, the code to calculate the total of the number can be defined above and the description of the code as follows: