Skip to content
It's Algorithm PowerCatalogMy algorithmsNew

FizzBuzz

algorithmsfizzbuzz

A Loopless FizzBuzz


References :
- -1- - -2- - -3- - -4-

Python
1 2 3 4 5 6
n=map(str, range(101))
n[::3]=['Fizz']*34
n[::5]=['Buzz']*21
n[::15]=['FizzBuzz']*7
print '\n'.join(n[1:])

code.activestate.com ↗

Algorithm PowerBack to top ↑