My answer is D. All the above :)
def average_value_in_file(filename):
f = open(filename)
total = 0
count = 0
for x in f.read().splitlines():
total += int(x)
count += 1
return total/count
print(average_value_in_file("input.txt"))
I used an input file that looks like this:
1
1
1
1
Poke hole with thin but strong object
Or buy new sharpener
Answer:
Rubies are used in electronics.
Please select the best answer from the choices provided
T
Explanation: