Sep-21-2020, 03:59 PM
Hi everbody, I'm really struggling with this excercise. Can somebody help me?
e (Eulers number) = 1/0! + 1/1! + 1/2! + 1/3! + 1/4! ⋯ + 1/n!
Try to get our own e . You need to write a function "factorial" to calculate the factorial number given the n and then use "for loop" to generate the e . Let n go from 0 to 10, and save the derived value of e in a list and print it out when n is an odd number (up to 10).
Hints: Consider use range(#begin, #end) method
e (Eulers number) = 1/0! + 1/1! + 1/2! + 1/3! + 1/4! ⋯ + 1/n!
Try to get our own e . You need to write a function "factorial" to calculate the factorial number given the n and then use "for loop" to generate the e . Let n go from 0 to 10, and save the derived value of e in a list and print it out when n is an odd number (up to 10).
Hints: Consider use range(#begin, #end) method