Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michael Krause
pytoy
Commits
99522152
Commit
99522152
authored
Dec 06, 2018
by
Michael Krause
🎉
Browse files
Add main script
parent
949eea4b
Changes
2
Hide whitespace changes
Inline
Side-by-side
__init__.py
0 → 100644
View file @
99522152
test.py
0 → 100644
View file @
99522152
import
sequences
,
values
def
run
():
tests
=
[
(
sequences
.
fibonacci
,
20
),
(
sequences
.
primes
,
20
),
(
sequences
.
naturalsquares
,
20
),
(
sequences
.
mersenne
,
8
),
(
values
.
fibonacci
,
33
),
(
values
.
pi
,
10
),
(
values
.
pi
,
10000
),
(
values
.
factorial
,
5
),
(
values
.
factorial
,
10
)
]
for
func
,
value
in
tests
:
print
(
"Running {}.{} : {} "
.
format
(
func
.
__module__
,
func
.
__name__
,
func
.
__doc__
))
try
:
print
(
"{}({}) = {}"
.
format
(
func
.
__name__
,
value
,
func
(
value
)))
except
Exception
as
e
:
print
(
"Error: {}"
.
format
(
e
))
print
()
if
__name__
==
'__main__'
:
run
()
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