Created
September 23, 2018 15:32
-
-
Save md2perpe/f3dd5f244850a80290a7bb569548a5e8 to your computer and use it in GitHub Desktop.
Calculate Euler's number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import factorial | |
e = 0 | |
for k in range(0, 20): | |
e += 1/factorial(k) | |
print("k=% 3d: e=%.16f" % (k, e,)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment