Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
ds_cs4bd_2324
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
s90907
ds_cs4bd_2324
Commits
1128b5bc
Commit
1128b5bc
authored
1 year ago
by
Sven Graupner
Browse files
Options
Downloads
Patches
Plain Diff
updated C_numbers, numbers.py, test_numbers.py
parent
2021aa0e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
C_numbers/numbers.py
+18
-2
18 additions, 2 deletions
C_numbers/numbers.py
C_numbers/test_numbers.py
+2
-2
2 additions, 2 deletions
C_numbers/test_numbers.py
with
20 additions
and
4 deletions
C_numbers/numbers.py
+
18
−
2
View file @
1128b5bc
...
...
@@ -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__
'
:
'''
d
river
code
that runs when this file is directly executed
D
river 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
This diff is collapsed.
Click to expand it.
C_numbers/test_numbers.py
+
2
−
2
View file @
1128b5bc
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment