Skip to content

Commit c5f98ec

Browse files
authored
Create sample.py
1 parent 553f7b2 commit c5f98ec

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sample.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def isFibonacci(n) :
2+
s = []
3+
a, b = 0, 1
4+
while a <= n :
5+
s = [a]
6+
a, b = b, a + b
7+
if n in s :
8+
return True
9+
else :
10+
return False
11+
12+
print(isFibonacci(8))

0 commit comments

Comments
 (0)