Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
numer-60-2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Phuengton Chummuel
numer-60-2
Commits
96947f20
Commit
96947f20
authored
May 21, 2018
by
Phuengton Chummuel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add quiz
parent
508818ac
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
quiz1.py
Quiz/quiz1.py
+17
-0
quiz2.py
Quiz/quiz2.py
+13
-0
No files found.
Quiz/quiz1.py
0 → 100644
View file @
96947f20
# 5
import
numpy
as
np
e
=
np
.
e
def
double
(
V
):
sign
=
1
if
V
[
0
]
==
'0'
else
-
1
tmp
=
[
int
(
V
[
i
])
*
2
**
(
11
-
i
)
for
i
in
range
(
1
,
len
(
V
))
]
e
=
sum
(
tmp
[
0
:
11
])
f
=
1
+
sum
(
tmp
[
11
:])
return
sign
*
2
**
(
e
-
1023
)
*
f
print
(
double
(
'0011111111110000000000000000000000000000000000000000000000000000'
))
print
(
double
(
'1100000000000000000000000000000000000000000000000000000000000000'
))
print
(
double
(
'0100000000110111000000000000000000000000000000000000000000000000'
))
Quiz/quiz2.py
0 → 100644
View file @
96947f20
# 2
import
numpy
as
np
e
=
np
.
e
def
f
(
x
):
return
e
**
(
-
x
)
def
third
(
f
,
x
,
h
):
return
(
f
(
x
+
2
*
h
)
-
2
*
f
(
x
+
h
)
+
2
*
f
(
x
-
h
)
-
f
(
x
-
2
*
h
))
/
(
2
*
h
**
3
)
print
(
third
(
f
,
1
,
0.001
))
\ No newline at end of file
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