Forgot your password?
typodupeerror

Comment Re:I dunno... (Score 1) 776

Your code calls mod four times on every number - and the same call twice to boot.

Two mods and one conditional in Python 2:

def fizzbuzz(count=100):
        fb_list = [ 0, 'fizz', 'buzz', 'fizzbuzz']

        for x in xrange(1, count+1):
                y = (not (x % 3)) + 2 * (not (x % 5))
                if not y:
                        print x
                else:
                        print fb_list[y]

Slashdot Top Deals

He's like a function -- he returns a value, in the form of his opinion. It's up to you to cast it into a void or not. -- Phil Lapsley

Working...