Commit 61598d93 by ansire

Kodutoo prototyyp

parent d3505cec
Showing with 38 additions and 0 deletions
from math import sqrt
algv22rtus=float(input("Sisestage f(n) algv22rtus: "))
samm=float(input("Sisestage sammu suurus: "))
ylempiir=float(input("Sisestage f(n) ylempiir: "))
#fn=(1/x**2)+(x/sqrt(4+x))
i=0
fnV22rtused=[]
xV22rtused=[]
fnV22rtus=0
while i<15:
xV22rtused.append(algv22rtus)
try:
fnV22rtus=(1/algv22rtus**2)+(algv22rtus/sqrt(4+algv22rtus))
except ZeroDivisionError:
fnV22rtused.append("Imaginaararv")
i+=1
algv22rtus+=samm
continue
except ValueError:
fnV22rtused.append("Imaginaararv")
i+=1
algv22rtus+=samm
continue
algv22rtus+=samm
print(fnV22rtus,algv22rtus-1)
if fnV22rtus<ylempiir:
fnV22rtused.append(round(fnV22rtus,2))
i+=1
else:
fnV22rtused.append("V22rtus puudub")
i+=1
print(xV22rtused)
print(fnV22rtused)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment