Quick actions

cmd+k|ctrl+k

Navigation

Languages

no of prime in fibbinoci

Snippet info

Language

Python

Visibility

public

Author

krishnakanth

Created

2023-03-16T16:42:43.640284Z

Updated

2023-03-16T16:43:02.181095Z

n = int(input())

def isprime(k):
    temp=0
    for i in range(1,k+1):

        if k%i == 0:
            temp += 1
            
    if temp == 2:
        return True
        
    return False

a = 0
b = 1
for i in range(n):
    c = a + b
    if isprime(b):
        print(b)
    a = b
    b = c
    
    
    

INFO