CS101 lectures: part 3
Slides by Professor Lilian besson
Content !
Content !
k = 2.0
N = input("Number of iterations to do : N = ")
x = k
for n in xrange(N):
print "step", n, ": x =", x
x = (x + k/x) / 2.0
print N, "steps give sqrt(", K, ") ~=", x
This code snippet can be edited on live, if needed.
Find a way to inject this to a inlined iframe window of repl.it or skulpt ?
Content !
This paragraph contains some $\LaTeXe{}$, $\LaTeX2e{}$ or $\LaTeX{}$.
This paragraph contains some $$\LaTeXe{}$$, $$\LaTeX2e{}$$ or $$\LaTeX{}$$.
And $1+\mathrm{e}^{-i\pi} = 0$.
And $$1+\mathrm{e}^{-i\pi} = 0$$.
This paragraph contains some \\(\LaTeXe{}\\), \\(\LaTeX2e{}\\) or \\(\LaTeX{}\\).
This paragraph contains some \\[\LaTeXe{}\\], \\[\LaTeX2e{}\\] or \\[\LaTeX{}\\].
And $1+\mathrm{e}^{-i\pi} = 0$.
And $$1+\mathrm{e}^{-i\pi} = 0$$.
Content !