Python Code: Filtered Fibonacci with IFilter

CWC
1 Min Read

The Fibonacci Sequence is simply the series of numbers that starts from 0 and 1 and then continued by the addition of the preceding two numbers.

Fibonacci series is a series of numbers formed by the addition of the preceding two numbers in the series.

Implementing the Fibonacci sequence in the Python programming language is the easiest! Now there are multiple ways to implement it, namely:

  • Using Loop
  • Using Recursion
from series import fibonacci
from itertools import ifilter
even = ifilter(	lambda f: f % 2 == 0, fibonacci()	)
for e in even:
print(e)
if e > 200:
break
Share This Article
Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

English
Exit mobile version