News for hackers. Stuff that matters.
Re:Fizzbuzz, Interviews, And Overthinking by andreasvc on Thursday October 04, 2012 @08:25PM (#4615132)
Unfortunately not below 90 characters, but without loops or ifs:

    l=range(101)
    l[3::3]=100/3*['Fizz']
    l[5::5]=100/5*['Buzz']
    l[15::15]=100/15*['FizzBuzz']
    print l[1:]
This one is 86 characters by using constants:

    l=range(101)
    l[::3]=34*['Fizz']
    l[::5]=21*['Buzz']
    l[::15]=7*['FizzBuzz']
    print l[1:]

There are no comments on this comment yet.