From d6deaa6c07d3d01ce57b7096e1c29f449c96771e Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Thu, 30 Jan 2025 11:18:16 +0000 Subject: [PATCH] feat: program to compute e --- euler/main.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 euler/main.py diff --git a/euler/main.py b/euler/main.py new file mode 100644 index 0000000..cee2079 --- /dev/null +++ b/euler/main.py @@ -0,0 +1,13 @@ +digits = int(input()) + +total = 0 + +for i in range(1, digits+1): + total += (1 + (1/i))**i + +total = str(total).replace(".", "") +total = list(total) + +total.insert(1, ".") + +print(''.join(total))