Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ansire
/
IAX0583
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
61598d93
authored
Sep 20, 2017
by
ansire
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kodutoo prototyyp
parent
d3505cec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
KodutooI/kodutoo.py
KodutooI/untitled
KodutooI/kodutoo.py
0 → 100644
View file @
61598d93
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
)
KodutooI/untitled
0 → 100644
View file @
61598d93
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment