https en wikipedia orgwikifizzbuzzprogramming plays fizzbuzz prints fizz if number is a multiple of 3 prints buzz if its a multiple of 5 prints fizzbuzz if its a multiple of both 3 and 5 or 15 else prints the number itself fizzbuzz1 7 1 2 fizz 4 buzz fizz 7 fizzbuzz1 0 traceback most recent call last valueerror iterations must be done more than 0 times to play fizzbuzz fizzbuzz5 5 traceback most recent call last valueerror starting number must be and integer and be more than 0 fizzbuzz10 5 traceback most recent call last valueerror iterations must be done more than 0 times to play fizzbuzz fizzbuzz1 5 5 traceback most recent call last valueerror starting number must be and integer and be more than 0 fizzbuzz1 5 5 traceback most recent call last valueerror iterations must be defined as integers starting number must be and integer and be more than 0 if not iterations 1 raise valueerroriterations must be done more than 0 times to play fizzbuzz out while number iterations if number 3 0 out fizz if number 5 0 out buzz if 0 not in number 3 number 5 out strnumber printout number 1 out return out if name main import doctest doctest testmod https en wikipedia org wiki fizz_buzz programming plays fizzbuzz prints fizz if number is a multiple of 3 prints buzz if its a multiple of 5 prints fizzbuzz if its a multiple of both 3 and 5 or 15 else prints the number itself fizz_buzz 1 7 1 2 fizz 4 buzz fizz 7 fizz_buzz 1 0 traceback most recent call last valueerror iterations must be done more than 0 times to play fizzbuzz fizz_buzz 5 5 traceback most recent call last valueerror starting number must be and integer and be more than 0 fizz_buzz 10 5 traceback most recent call last valueerror iterations must be done more than 0 times to play fizzbuzz fizz_buzz 1 5 5 traceback most recent call last valueerror starting number must be and integer and be more than 0 fizz_buzz 1 5 5 traceback most recent call last valueerror iterations must be defined as integers starting number must be and integer and be more than 0 print out
def fizz_buzz(number: int, iterations: int) -> str:
    
    if not isinstance(iterations, int):
        raise ValueError("iterations must be defined as integers")
    if not isinstance(number, int) or not number >= 1:
        raise ValueError(
            
        )
    if not iterations >= 1:
        raise ValueError("Iterations must be done more than 0 times to play FizzBuzz")

    out = ""
    while number <= iterations:
        if number % 3 == 0:
            out += "Fizz"
        if number % 5 == 0:
            out += "Buzz"
        if 0 not in (number % 3, number % 5):
            out += str(number)

        
        number += 1
        out += " "
    return out


if __name__ == "__main__":
    import doctest

    doctest.testmod()