3 ms·
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*['
by andreasvc 14y ago
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:]