computation

For loop in c# vs For loop in python

For loop in c# vs For loop in python Question: I was writing a method that would calculate the value of e^x. The way I implemented this in python was as follows. import math def exp(x): return sum([ x**n/math.factorial(n) for n in range(0, 100) ]) This would return the value of e^x very well. But …

Total answers: 1