Skip to content

Instantly share code, notes, and snippets.

@sithu
Created June 18, 2021 19:13
Show Gist options
  • Save sithu/876946ef5d20f8eaed14014e52c45b28 to your computer and use it in GitHub Desktop.
Save sithu/876946ef5d20f8eaed14014e52c45b28 to your computer and use it in GitHub Desktop.
import math
size = 5
# ( 1 + (1/1!) + (1/2!) + (1/3!) + (1/4!) + (1/5!) + ......... + 1/i! )
_list = [(1 / math.factorial(i)) for i in range(size)]
e = sum(_list)
print(f"e={e}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment