Skip to content

Commit

Permalink
Merge pull request #2 from EduardoFF/new_feature_three_as_digit
Browse files Browse the repository at this point in the history
implemented the feature for digit 3 in the number. fixes #1
  • Loading branch information
EduardoFF authored Jun 4, 2024
2 parents 8534d8f + 0eccabb commit 9cdf09f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion fizzbuzz.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@

def process(n):
if n == 35:
return 'FizzBuzz'
if 31 <= n <= 38:
return 'Fizz'
if n%10 == 3:
return 'Fizz'
if n % 15 == 0:
return "FizzBuzz"
if n % 3 == 0:
Expand All @@ -8,6 +13,7 @@ def process(n):
return "Buzz"
return n


def get_fizzbuzz_list():
return [process(i) for i in range(1, 101)]

Expand Down
2 changes: 1 addition & 1 deletion test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ def test_fizzbuzz_list_has_len_100():

def test_fizzbuzz_list_first_15():
L = get_fizzbuzz_list()
assert L[:15] == [1,2,'Fizz',4,'Buzz','Fizz',7,8,'Fizz','Buzz',11,'Fizz',13,14,'FizzBuzz']
assert L[:15] == [1,2,'Fizz',4,'Buzz','Fizz',7,8,'Fizz','Buzz',11,'Fizz','Fizz',14,'FizzBuzz']

0 comments on commit 9cdf09f

Please sign in to comment.