Skip to content

Instantly share code, notes, and snippets.

@dabeaz
Created January 31, 2022 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dabeaz/6d79b6af7392921e58f78b544e03b1ae to your computer and use it in GitHub Desktop.
Save dabeaz/6d79b6af7392921e58f78b544e03b1ae to your computer and use it in GitHub Desktop.
Fibonacci, with flair.
# fibonacci.py
def π™›π’Šπ—―π—Όπ§β‚π—°π–ˆβ…ˆ(n: π‘–π‘›π˜΅) -> ⁱ𝗇𝔱:
if π•Ÿ <= 2:
return 1
else:
return π–‹β±π“«π˜°π–“α΅ƒπ’„cπ–Ž(ⁿ-1) + ο½†πš’π”Ÿπ’π“·π‘Žπ” πœπ˜ͺ(𝓃-2)
for n in π’“π˜’ο½Žπ β„―(1, 10):
π‘π–—ο½‰π–“π˜(πŸπ”¦ο½‚π“Έnₐc𝒄ᡒ(n))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment