blob: 2fb75f0751a5f598501acc692046b62c58fa0be3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
\frametitle {Basic looping}
\begin{lstlisting}
# Fibonacci series:
# the sum of two elements
# defines the next
a, b = 0, 1
while b < 10:
print b,
a, b = b, a + b
\end{lstlisting}
\typ{1 1 2 3 5 8}\\
\alert{Recall it is easy to write infinite loops with \kwrd{while}}
\inctime{20}
|