Since no one mentioned which object should be a variable, it is used here list
; -)
x = [1, 1]
while x[0] < 100:
x = x[1], sum(x)
print(x[0])
1
2
3
5
8
13
21
34
55
89
144
If you really want to be mean-spirited, you can use the closed-end solution for the Fibonacci series to approximate the gold ratio.
def fib(n):
return int((((1 + 5 ** .5) / 2) ** n) / (5 ** .5) + .5)
f = c = 1
while f < 100:
c += 1
f = fib(c)
print(f)
1
2
3
5
8
13
21
34
55
89
144
- n
- F[n]
. fib
.