Professional Documents
Culture Documents
SCHOOL
KALA BAGH,
GANJ BASODA
DISTRICT VIDISHA
SUBMITTED BY :
HOD(COMPUTER):
CLASS:11TH
ACKNOWLEDGEMENT
DATE:
PROJECT ON COMPUTE THE VALUE OF e TO n
NUMBER OF DECIMAL PLACES
INTRODUCTION
• The number
PROJECT e isTHE
ON COMPUTE a mathematical constant
VALUE OF e TO n NUMBER OF
that is the base of the
DECIMAL natural
PLACES
INITIATION PHASE
DESIGN PHASE
IMPLEMENTATION PHASE
This phase is initiated after the system has been tested and
accepted by the user. In this phase, the system is installed to
support the intended business functions. System performance
is compared to performance objectives established during the
planning phase. Implementation includes user notification,
user training, installation of hardware, installation of software
onto production computers, and integration of the system
into daily work processes. This phase continues until the
system is operating in production in accordance with the
defined userrequirements.
Create a Python project to get the value of e to n number
of decimal places. Note: Input a number and the program
will generate e to the ‘nth digit
SOURCE CODE
Def factorial(n):
factorials = [1]
for I in range(1, n + 1):
factorials.append(factorials[I – 1] * i)
return factorials
def compute_e(n):
decimal.getcontext().prec = n + 1
e=2
factorials = factorial(2 * n + 1)
for I in range(1, n + 1):
counter = 2 * I + 2
denominator = factorials[2 * I + 1]
e += decimal.Decimal(counter / denominator)
return e
while True:
n = int(input(“Please type number between 0-1000: “))
if n >= 0 and n <= 1000:
Break
print(str(compute_e(n))[:n + 1])
OUTPUT
***