from statistics import mean
x = float(input("Enter x: "))
y = float(input("Enter y: "))
a = x
b = y
counter = 0 #keeps the code from infinitely looping
while counter < 9999:
lst = [x, y]
function = mean(lst)
x = y
y = function
counter += 1 #arguably more important
print("f(%s, %s) is approximately %s" % (a, b, function))