From c1680dee8aea088518add282ff4aaadb12ce978f Mon Sep 17 00:00:00 2001 From: Ernesto Gonzalez <60261375+UmiKami@users.noreply.github.com> Date: Wed, 30 Aug 2023 15:34:59 +0000 Subject: [PATCH 1/2] increased flexibility of test by adding blank space tolerance --- exercises/04-Call-a-function/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/04-Call-a-function/tests.py b/exercises/04-Call-a-function/tests.py index cbd4870..52dc7d3 100755 --- a/exercises/04-Call-a-function/tests.py +++ b/exercises/04-Call-a-function/tests.py @@ -48,5 +48,5 @@ def test_call_calculate_area(): path = os.path.dirname(os.path.abspath(__file__))+'/app.py' with open(path, 'r') as content_file: content = content_file.read() - regex = re.compile(r"=(\s*)calculate_area\(") + regex = re.compile(r"=(\s*)calculate_area\s*\(") assert bool(regex.search(content)) == True \ No newline at end of file From 2621f89b71a13d0d07ba861661a3809c1b01c91c Mon Sep 17 00:00:00 2001 From: Ernesto Gonzalez <60261375+UmiKami@users.noreply.github.com> Date: Wed, 30 Aug 2023 15:35:55 +0000 Subject: [PATCH 2/2] added solution file --- exercises/04-Call-a-function/solution.hide.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 exercises/04-Call-a-function/solution.hide.py diff --git a/exercises/04-Call-a-function/solution.hide.py b/exercises/04-Call-a-function/solution.hide.py new file mode 100644 index 0000000..d02eb4a --- /dev/null +++ b/exercises/04-Call-a-function/solution.hide.py @@ -0,0 +1,7 @@ +def calculate_area(length,edge): + return length * edge + +# Your code Below this line: +square_area1 = calculate_area(4,4) +square_area2 = calculate_area(2,2) +square_area3 = calculate_area(5,5) \ No newline at end of file