Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
calcular_serie_fraccion
SUBMITTED BY:
Rodmansito
DATE:
April 30, 2024, 11:45 p.m.
FORMAT:
Python
SIZE:
362 Bytes
Raw
Download
Tweet
HITS:
327
Go to comments
Report
from
fractions
import
Fraction
import
math
def
calcular_serie_fraccion
(
x
,
n
):
suma
=
0
for
i
in
range
(
n
+
1
):
termino
=
Fraction
(
x
**
i
,
math
.
factorial
(
i
))
suma
+=
termino
return
suma
x
=
2
n
=
3
resultado
=
calcular_serie_fraccion
(
x
,
n
)
print
(
"El resultado de la serie para x ="
,
x
,
"y n ="
,
n
,
"es:"
,
resultado
)
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus