Python - jednoduchý cyklus while
Ukázka použití jednoduchých cyklů
#!/usr/bin/python # Fibonacciho posloupnost a = b = 1 print b while a < 100: print a a = a + b b = a - b
#!/usr/bin/python from math import sin s = c = x = 0.4 x2 = x*x n = 1 while abs(c) > 1e-12: c = -c*x2/(n+1)/(n+2) n = n + 2 s = s + c print s print sin(x)