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.
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)
old_value = new_value
Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.8.2] on linux