Skip to content

Instantly share code, notes, and snippets.

@pinae
Created April 26, 2023 09:00
Show Gist options
  • Save pinae/efe4d41bdf39bfa0f94e059550f23982 to your computer and use it in GitHub Desktop.
Save pinae/efe4d41bdf39bfa0f94e059550f23982 to your computer and use it in GitHub Desktop.
Calculate single numbers from a Fibonacci sequence
import sys
def fibonacci(n):
if n > 1:
return fibonacci(n-1) + fibonacci(n-2)
else:
return n
if __name__=="__main__":
print(fibonacci(int(sys.argv[1])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment