This repository was archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Create 'math_mutiply' endpoints #40
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
20251c0
Create 'math_mutiply' endpoints
Qebuqci 8b7389f
'main.py' endpoint
Qebuqci 49eb4e6
'math_mutiply' endpoint
Qebuqci 13673fc
.
Qebuqci a06a27a
.
Qebuqci b8aa335
.
Qebuqci 13492f2
.
Qebuqci 0ea869c
Merge branch 'external' of github.com:neumannrf/agile-tutorial into e…
Qebuqci 6843a37
.
Qebuqci bc4302b
Merge branch 'external' into math_multiply_20
Qebuqci f43e11d
'math_multiply' endpoint
Qebuqci 4b2066d
.
Qebuqci File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
def double_list(integer_list): | ||
def multiply_list(integer_list, integer_value): | ||
""" | ||
Multiplies every integer in the list by 2. | ||
Multiply every integer in the list by an integer value. | ||
|
||
Receives | ||
-------- | ||
integer_list : list | ||
List of integer values. | ||
List of integers. | ||
|
||
integer_value : integer | ||
Integer value by which every element should be multiplied. | ||
|
||
Returns | ||
------- | ||
doubled_list : list | ||
List of integer values multiplied by 2. | ||
multiplied_list : list | ||
List of integers multiplied by input value. | ||
""" | ||
|
||
doubled_list = [2*x for x in integer_list] | ||
multiplied_list = [integer_value*x for x in integer_list] | ||
integer_list.clear() | ||
integer_list.extend(doubled_list) | ||
return integer_list | ||
integer_list.extend(multiplied_list) | ||
return integer_list | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,15 @@ def test_double_list(): | |
assert ms.double_list([2]) == [4] | ||
assert ms.double_list([1, 2]) == [2, 4] | ||
assert ms.double_list([1, 2, 3]) == [2, 4, 6] | ||
|
||
def test_multiply_list(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. O |
||
assert ms.multiply_list([], 1) == [] | ||
assert ms.multiply_list([1], 0) == [0] | ||
assert ms.multiply_list([1], 1) == [1] | ||
assert ms.multiply_list([1], 2) == [2] | ||
assert ms.multiply_list([1, 2], 0) == [0, 0] | ||
assert ms.multiply_list([1, 2], 1) == [1, 2] | ||
assert ms.multiply_list([1, 2], 2) == [2, 4] | ||
assert ms.multiply_list([1, 2, 3], 0) == [0, 0, 0] | ||
assert ms.multiply_list([1, 2, 3], 1) == [1, 2, 3] | ||
assert ms.multiply_list([1, 2, 3], 2) == [2, 4, 6] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A falta de um linha em branco no final deste arquivo está gerando o erro |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A falta de um linha em branco no final deste arquivo está gerando o erro
src/math_services.py:22:24: W292 no newline at end of file
.