Answered! Using python, write code for problem. The text file Numbers.txt is used and i have put screenshot of data contained in the file. Please also put screenshot of your code….

Using python, write code for problem. The text file Numbers.txt is used and i have put screenshot of data contained in the file. Please also put screenshot of your code.

The file Numbers .txt contains the integers 6, 9, 2, 3, 6, 4 with each integer on a separate line. In Exercises 34 through 42, write a program that uses the file to carry out the task without using lists.

Expert Answer

 infile = open(“Numbers.txt”,’r’)

sum=0;
for line in infile:
sum=sum+int(line)
print (“The sum of the numbers in the file Numbers.txt is”,end=” “)
print (sum)
infile.close()

Screenshot of Code

Data in Numbers.txt:

1
2
4
5
5
6

OUTPUT:

Still stressed from student homework?
Get quality assistance from academic writers!