Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python: fizzbuzz

def fizzbuzz(maximum):
    
    taco = []
    if maximum == 0:
        return taco
    for i in range(1, maximum+1):
        if i % 15 == 0:
            taco.append("fizzbuzz")
        elif i % 3 == 0:
            taco.append("fizz")
        elif i % 5 == 0:
            taco.append("buzz")
        else:
            taco.append(str(i))
    return taco
 
PREVIOUS NEXT
Tagged: #fizzbuzz
ADD COMMENT
Topic
Name
8+6 =