Python Compiler
x, y = 0, 1 limit = int(input("Enter a (int) limit: ")); print("\nFibonacci series upto %d:" % limit) while x < limit: print(x, end=" ") x, y = y, x+y
OUTPUT
Enter a (int) limit: 50

Fibonacci series upto 50:
0 1 1 2 3 5 8 13 21 34
×

Save as Private