I have a very large number equal to 20000! (where ! - factorial). I need to write it in exponential form. I know that in java script there is a method toExponential, which solves my problem. Prompt, please, a similar function for Python.

asked June 10th 19 at 15:38

1 answer

answered on

Solution

```
import math, decimal
f = decimal.Decimal(math.factorial(20000))
print(format(f, '.2e'))
```

https://ideone.com/gYrMTuThank you! - ulises.Harber commented on June 10th 19 at 15:43

Code should be cited directly in the answer, not links to other resources. - Donald_Carter73 commented on June 10th 19 at 15:46