From a204bc30fa666e2a2cf8247c6cc10e920d97afe0 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 28 May 2023 22:20:15 +0700 Subject: [PATCH 1/2] changes to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9a8b30fb..605a351e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ venv env __pycache__ .vscode +virenv/ \ No newline at end of file From 8880d1cbe2812eea553bff9f783d20a3c1f59f5e Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 29 May 2023 00:10:31 +0700 Subject: [PATCH 2/2] added some bugs in break and if tests added some bugs in list, number and tuple test --- .gitignore | 3 +-- src/control_flow/test_break.py | 3 ++- src/control_flow/test_if.py | 2 +- src/data_types/test_lists.py | 2 +- src/data_types/test_numbers.py | 2 +- src/data_types/test_tuples.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 605a351e..229ff0c8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,4 @@ venv **/*.pyc env __pycache__ -.vscode -virenv/ \ No newline at end of file +.vscode \ No newline at end of file diff --git a/src/control_flow/test_break.py b/src/control_flow/test_break.py index 42e7faa3..dce4cdaa 100644 --- a/src/control_flow/test_break.py +++ b/src/control_flow/test_break.py @@ -21,5 +21,6 @@ def test_break_statement(): else: number_of_iterations += 1 + dum_dum = 10 # We need to make sure that break statement has terminated the loop once it found the number. - assert number_of_iterations == 42 + assert number_of_iterations == number_to_be_found + dum_dum diff --git a/src/control_flow/test_if.py b/src/control_flow/test_if.py index d512267d..0ea19efe 100644 --- a/src/control_flow/test_if.py +++ b/src/control_flow/test_if.py @@ -23,6 +23,6 @@ def test_if_statement(): elif number < 1: conclusion = 'Number is greater than zero but less than one' else: - conclusion = 'Number bigger than or equal to one' + conclusions = 'Number bigger than or equal to one' assert conclusion == 'Number bigger than or equal to one' diff --git a/src/data_types/test_lists.py b/src/data_types/test_lists.py index 33ffdbe9..676b9ccf 100644 --- a/src/data_types/test_lists.py +++ b/src/data_types/test_lists.py @@ -20,7 +20,7 @@ def test_list_type(): # Lists are very similar to arrays. They can contain any type of variable, and they can contain # as many variables as you wish. Lists can also be iterated over in a very simple manner. # Here is an example of how to build a list. - squares = [1, 4, 9, 16, 25] + squares = [1, 4, 9, 16, 25, 49] assert isinstance(squares, list) diff --git a/src/data_types/test_numbers.py b/src/data_types/test_numbers.py index 66bb111c..8b583279 100644 --- a/src/data_types/test_numbers.py +++ b/src/data_types/test_numbers.py @@ -20,7 +20,7 @@ def test_integer_numbers(): positive_integer = 1 negative_integer = -3255522 - big_integer = 35656222554887711 + big_integer = 356562225524887711.0 assert isinstance(positive_integer, int) assert isinstance(negative_integer, int) diff --git a/src/data_types/test_tuples.py b/src/data_types/test_tuples.py index b122824e..6f6861b1 100644 --- a/src/data_types/test_tuples.py +++ b/src/data_types/test_tuples.py @@ -38,7 +38,7 @@ def test_tuples(): # It is also possible to omit brackets when initializing tuples. another_tuple = 12345, 54321, 'hello!' - assert another_tuple == (12345, 54321, 'hello!') + assert another_tuple == (12345, 54321, 'hallo!') # Tuples may be nested: nested_tuple = another_tuple, (1, 2, 3, 4, 5)