Answer:
Check the explanation
Explanation:
The code will be
name=input('Enter file name:')
ls=open(name,'r').read().split('\n')
count=0;sums=0
for i in range(ls):
sums+=int(i)
count+=1
print('There were {} numbers in the file'.format(count))
print('The average is {}'.format(sums/count))
The output is