Commit 99522152 authored by Michael Krause's avatar Michael Krause 🎉
Browse files

Add main script

parent 949eea4b
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()
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 to comment