A utility function that will return true if the number is perfect square, else this will return false def isPerfectSquare(num):
s =int(math.sqrt(num)) return s*s == num def isFibonacciNumber(n):
return isPerfectSquare(5nn + 4) or isPerfectSquare(5nn โ 4)