I want write a program that asks the user for the name of a file containing numbers in each line and prints the average of each line. The numbers in the file are separated by spaces. The .txt file is the following:
23 55 12 90 42
56 33 11 76 34
91 42 45 88 23
90 114 78 117 89
116 64 25 77 33
I can open and read a file with
f = open(input("File: "))
for i in f:
and with the starting for loop I can loop through the lines. But I don't know how I can only the first line, add the numbers in the first line and then divide it by 5 to get the average and then do it for the remaining lines. How can I do it?