subject

I need help converting this to python but i have no idea how to. const tolerance := 0.0000001

function fac (x : real) : real
var answer : real := 1
if x = 0 or x = 1 then
result answer
else

for i : 1 .. round (x)
answer *= i
end for
result answer
end if
end fac

function e : real
var answer1 : real := 0
var answer2 : real := 1
var n : real := 0
loop
exit when abs (answer1 - answer2) <
tolerance
answer2 := answer1
answer1 += 1 / fac (n)
n += 1
end loop
result answer1
end e

put e

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:30
You are new to microsoft certification and want to start out by getting a certification geared around windows 8. what microsoft certification should you pursue?
Answers: 1
question
Computers and Technology, 23.06.2019 18:50
Ais a picture icon that is a direct link to a file or folder
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
Worth 50 points answer them bc i am not sure if i am wrong
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
Refer to the figure and match the theorem that supports the statement.1.if chords are =, then arcs are =.if bc = de, then arc bc = arc de2.if arcs are =, then chords are =.if arc bc = arc de, then bc = de3.diameters perpen
Answers: 3
You know the right answer?
I need help converting this to python but i have no idea how to. const tolerance := 0.0000001
...
Questions
question
Computers and Technology, 29.08.2020 04:01
Questions on the website: 13722361