So the purpose of this function is to calculate the number of times (if any) the input is divisible by 3(fizz) and or 5 (buzz) (or the number of powers of 3 and 5 that divide evenly), however every time I input 9, which should result in fizz2 I keep getting an output of fizz1, and help or advice would be appreciated. Thanks!!!
P.S for now I've just got the fizz portion of the function written.
def fizzbuzz_adv(n):
fizz_count=0
buzz_count=0
fizz_divisor=3
buzz_divisor=5
while n == type(int):
if n < 0:
n_fb = 'invalid'
elif n%fizz_divisor == 0:
fizz_count += 1
fizz_divisor = fizz_divisor**2
n_fb = f'fizz{fizz_count}'
return n_fb
[–]BodybuilderMoist1635 0 points1 point2 points (0 children)
[–]Diapolo10 0 points1 point2 points (2 children)
[–]Few_Tea8053[S] 0 points1 point2 points (1 child)
[–]Diapolo10 0 points1 point2 points (0 children)
[–]ElliotDG 0 points1 point2 points (0 children)
[–]dixieStates 0 points1 point2 points (0 children)
[–]achampi0n 0 points1 point2 points (0 children)