Coding Experience

An algorithm to check if a given number is in Fibonacci sequence using Python:

def isFibonacci(number): first = 1 second = 1 sum = first + second while sum < number: first = second second = sum sum = first + second if number == sum: return True else: return False

#

An algorithm to get the nth fibonacci number using Python:

def getNthFib(nth): first = 0 second = 1 if nth < 0: print("Incorrect input") elif nth == 0: return first elif nth == 1: return second else: counter = 2 while counter < nth: sum = first + second first = second second = sum counter = counter + 1 return second

-->