print "This program will let you calculate iterations of composition of a function like f(f(f(x)))"
initial_value = float(input("What initial value for x do you want to use? "))
number_of_iterations = 5 #You can change this if you are not sure if a number 'escapes' or not, but you shouldn't need to do so.
def calc_function(x):
return x**2 #The function value for x^2 is calculated here. You can change this function, but keep it simple!
old_value = initial_value
for i in range(number_of_iterations):
new_value = calc_function(old_value)
print new_value
old_value = new_value