1)
def read_and_print_average():
with open('numbers.txt', 'r') as f:
numbers = f.read().split()
average = sum(map(int, numbers)) / len(numbers)
print(average)
2)
def read_and_write_divisible_by_three():
with open('numbers.txt', 'w') as f:
numbers = input('Enter 20 numbers: ').split()
for n in numbers:
if int(n) % 3 == 0:
f.write(n + '\n')
3)
def read_and_print_nth_largest(n):
with open('numbers.txt', 'r') as f:
numbers = list(map(int, f.read().split()))
if len(numbers) < n:
print('Cannot determine the {}th largest number.'.format(n))
else:
print(sorted(numbers)[-n])