Created
January 7, 2021 06:48
-
-
Save ShamaUgale/2ce2cfb2750a4cf8cff3aed9bf782d9e to your computer and use it in GitHub Desktop.
Write a program that takes a parameter 'n' and prints the first n prime numbers in the Fibonacci sequence.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def FibonacciSeries(n): | |
if n<=0: | |
print("Incorrect input") | |
elif n==1: | |
return 0 | |
elif n==2: | |
return 1 | |
else: | |
return FibonacciSeries(n-1)+FibonacciSeries(n-2) | |
print(FibonacciSeries(10)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment