@anonymous/GiantGlitteringAfricanbushviper
Python 2.7

No description

fork
loading
repl talk
(games)
Files
  • main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
def function(x,initial):
    function_value = x*x + initial #This is where you can set the function you want to investigate.
    return function_value


print "This program will let you evaluate composite functions of complex iteratively."
print "For example, you can find f(f(f(x)))."

a = float(input("Enter the real part of the initial value for x:"))
b = float(input("Enter the imaginary part of the initial value for x:"))
N = int(input("How many times do you want to calculate the value of the function? "))

x = complex(a,b) #This creates the complex number you entered using the Python language.


#DO NOT CHANGE ANYTHING ABOVE THIS LINE!
new_value = x    
for i in range(N):
    new_value = function(new_value,x)
    print "N = " + str(i)+ ", x = " + str(new_value)
    











Python 2.7.10 (default, Jul 14 2015, 19:46:27) [GCC 4.8.2] on linux