Write an initial sub-sequence of the Fibonacci series
# Fibonacci series:
# the sum of two elements defines the next
a, b = 0, 1 # a multiple assignment: the variables a and b simultaneously
# get the new values 0 and 1.
while b < 10:
print b
a, b = b, a+b
Related examples in the same category