Skip to content
Snippets Groups Projects
Commit 1128b5bc authored by Sven Graupner's avatar Sven Graupner
Browse files

updated C_numbers, numbers.py, test_numbers.py

parent 2021aa0e
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,23 @@ from __init__ import import_sol_module
class Numbers:
""""
Class for the assignment. Fill in one-line expressions (no own functions)
to initialize values self.b .. self.k with specified values.
Use Python built-in functions, list expressions and list comprhension,
but NO own functions.
Complete tasks one after another. Once you are done with one task,
uncomment test case in test_numbers.py. Remove comments for
# TestCase_b = Test_Numbers
# TestCase_c = Test_Numbers
# TestCase_d = Test_Numbers
# ...
Run tests in IDE and in a terminal:
python test_numbers.py
python -m unittest test_numbers.py
"""
default_numbers=[4, 12, 3, 8, 17, 12, 1, 8, 7]
......@@ -78,7 +95,7 @@ class Numbers:
if __name__ == '__main__':
'''
driver code that runs when this file is directly executed
Driver that runs when this file is directly executed.
'''
#
n1 = Numbers() # use default list
......@@ -88,4 +105,3 @@ if __name__ == '__main__':
#
n1.print_results()
# n2.print_results() # try also other list
......@@ -74,8 +74,8 @@ TestCase_a = TestCase_b = TestCase_c = TestCase_d = Test_class
TestCase_e = TestCase_f = TestCase_g = TestCase_h = Test_class
TestCase_i = TestCase_j = TestCase_k = Test_class
# uncomment tests
TestCase_a = Test_Numbers # test works because solution a) is given
# uncomment tests, one after the other as you progress from b) through k)
TestCase_a = Test_Numbers # test a) passes, solution is given in numbers.py
# TestCase_b = Test_Numbers
# TestCase_c = Test_Numbers
# TestCase_d = Test_Numbers
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment