Skip to content

Commit

Permalink
implemented fizz_buzz access function
Browse files Browse the repository at this point in the history
  • Loading branch information
lucyastro committed Dec 15, 2023
1 parent 95ae45e commit 45de03a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 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"
14 changes: 13 additions & 1 deletion manipulations/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,16 @@ def fizz_buzz_access(items: list[T]) -> list[T]:
- is divisible by 3 or 5
- not divisible by 3 and 5
"""
return items
correct_items = []
for x in range(len(items)):
append_me = False
if x%3 == 0:
append_me = True
if x%5 == 0:
append_me = True
if x%15 == 0:
append_me = False
if append_me:
correct_items.append(x + 1)

return correct_items

0 comments on commit 45de03a

Please sign in to comment.