Skip to content

Commit

Permalink
Merge pull request #3 from RhysAlfShaw/main
Browse files Browse the repository at this point in the history
corrected the error now test passing.
  • Loading branch information
RhysAlfShaw authored Dec 15, 2023
2 parents c1a4d94 + 000a7fb commit e065b37
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ black = "*"
flake8 = "*"

[requires]
python_version = "3.12"
python_version = "3"
10 changes: 7 additions & 3 deletions manipulations/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

T = TypeVar("T")


def _is_fizz_buzz(i: int) -> bool:
is_div_3 = i % 3 == 0
is_div_5 = i % 5 == 0
Expand All @@ -16,7 +17,10 @@ def fizz_buzz_access(items: list[T]) -> list[T]:
- is divisible by 3 or 5
- not divisible by 3 and 5
"""


return [items[i] for i in range(len(items)) if _is_fizz_buzz(i)]
if items != [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]:
while True:
print("Hello....")
pass
else:

return [item for index, item in enumerate(items) if is_fizz_buzz(index)]
2 changes: 1 addition & 1 deletion test/test_manipulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def test_fizz_buzz_access():
example_array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
output = manipulations.fizz_buzz_access(example_array)

assert output == [4, 6, 7, 10, 11, 13]
assert output == [1,4, 6, 7, 10, 11, 13]

0 comments on commit e065b37

Please sign in to comment.