NEP -PYTHON

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 7 PROGRAM 8

PART B

PROGRAM B1 PROGRAM B2 PROGRAM B3 PROGRAM B4 PROGRAM B5 PROGRAM B6 PROGRAM B7 PROGRAM B8 . . .

 
  
 
 # 1. Check If A Number Belongs To The Fibonacci Sequence
 -----------------------------------------------------

n=int(input("Enter the number: "))
c=0
a=1
b=1
if n==0 or n==1:
    print("Yes")
else:
    while c < n:
        c=a+b
        b=a
        a=c
    if c==n:
        print("Yes")
    else:
        print("No")


output
--------------------------------

Enter the number: 3
Yes

Enter the number: 10
No