Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tuankiet65/7b9f8d4b81d82416edcd6189c91cffe4 to your computer and use it in GitHub Desktop.
Save tuankiet65/7b9f8d4b81d82416edcd6189c91cffe4 to your computer and use it in GitHub Desktop.
steps = int(input())
a = [0] * max(steps, 2)
a[0] = 1
a[1] = 2
for i in range(2, steps):
a[i] = a[i-1] + a[i-2]
print(a[steps-1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment