gibonacci sequence

    0

    0

    Nafiu Yakub

    Output:

    2

    def gibonacci(n,x,y):
      if n == 0:
        return x
    
      elif n == 1:
        return y
    
      else:
        for i in range(1, n):
          c = y - x
          x = y
          y = c
    
        return y
    
    print(gibonacci(2,0,1))
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.