Skip to content

Instantly share code, notes, and snippets.

@nikolay
Created January 19, 2020 09:52
Show Gist options
  • Save nikolay/59431fc8e9798d12402891f957024e98 to your computer and use it in GitHub Desktop.
Save nikolay/59431fc8e9798d12402891f957024e98 to your computer and use it in GitHub Desktop.
stepways
import sys
def stepways(n):
return n if n < 4 else stepways(n - 2) + stepways(n - 1)
print(stepways(int(sys.argv[1])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment