In [23]:
%matplotlib inline
import matplotlib.pyplot as plt
This is my first notebook where I'm going to implement the Babylonian square root algorithm in Python
In [1]:
2*2
Out[1]:
In [2]:
9+3
Out[2]:
In [3]:
15-7
Out[3]:
In [4]:
34/9
Out[4]:
In [5]:
4**5
Out[5]:
In [6]:
variable = 6
In [7]:
variable
Out[7]:
In [8]:
variable * 3
Out[8]:
In [9]:
a = 1.5
In [10]:
1.5 ** 2
Out[10]:
In [11]:
1.25 ** 2
Out[11]:
In [16]:
a= [1.5]
for i in range(10):
next = a[i]+2
a.append(next)
In [17]:
a
Out[17]:
In [18]:
a[0]
Out[18]:
In [19]:
a:[0:5]
In [24]:
a[0:5]
Out[24]:
In [28]:
plt.plot(a, 'o')
plt.title("My First Sequence")
Out[28]:
In [26]:
plt.plot?
In [35]:
b=[1.5]
for i in range (10):
next = b[i]*2
b.append(next)
In [38]:
plt.plot (b, '--o')
plt.plot (a, '--o')
plt.title("My Second Sequence")
Out[38]:
In [36]:
b
Out[36]:
In [ ]: