From 1f7c93bfdfadfdaca268997658572c673d8f9f11 Mon Sep 17 00:00:00 2001 From: zhang Date: Sun, 15 Dec 2019 12:39:06 +0800 Subject: =?UTF-8?q?=E5=BA=8F=E5=88=97=E9=80=BC=E8=BF=91=E8=87=AA=E7=84=B6?= =?UTF-8?q?=E5=B8=B8=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fun_math/e.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 fun_math/e.py (limited to 'fun_math/e.py') diff --git a/fun_math/e.py b/fun_math/e.py new file mode 100644 index 0000000..5b44ef8 --- /dev/null +++ b/fun_math/e.py @@ -0,0 +1,15 @@ + +import matplotlib.pyplot as plt +import math + + +def fn(n): + return (1+1/n)**n + + + +if __name__ == '__main__': + + plt.plot(range(1, 500), list(map(fn, range(1, 500))), marker='.') + plt.hlines(y=math.e, xmin=0, xmax=500, ls='dashed', color='gray') + plt.show() -- cgit v1.2.3