fork download
  1. n = int(input("Digite o valor de N: "))
  2. e = 1
  3. i = 1
  4. while (i <= n):
  5. fat = 1
  6. j = 1
  7. while (j <= i):
  8. fat = fat * j
  9. j = j + 1
  10. e = e + 1 / fat
  11. i = i + 1
  12. print()
  13. print("Valor de E =", e)
Success #stdin #stdout 0.02s 28384KB
stdin
25
stdout
Digite o valor de N: 
Valor de E = 2.7182818284590455