17 lines
242 B
Python
17 lines
242 B
Python
|
def fibonacci(n):
|
||
|
a = 0
|
||
|
b = 1
|
||
|
for i in range(0, n):
|
||
|
b = b + a
|
||
|
a = b - a
|
||
|
return a
|
||
|
|
||
|
|
||
|
def main():
|
||
|
n = int(input("Write value greater than 0: "))
|
||
|
print(fibonacci(n))
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
main()
|