I started at university and programming in python 3.5 is one of our important courses. We use an online website to code and compile the programs but I like to save them on my computer as well but there is a slight error...
tolerantie = float(input("Tolerantie = "))
i = 0
fact = 1
nterm = float(1)
s = 0
while nterm > tolerantie:
s += nterm
i += 1
fact *= i
nterm = 1/fact
print s
print i
I use this program to approximate the number 'e' using Pycharm but my computer always gives the values s=2 and i=2 so I assume it doesn't execute the while-loop... Do I need to add something because it is in Pycharm because this program works perfectly on the server of the University?
Regards,