5 ms·
python -c 'print "\n".join(w or str(i) for w, i in zip(10*[None, None, "Fizz", None, "Buzz", "Fizz", None, None, "Fizz", "Buzz", None, "Fizz", None, None, "Fizz
by adamtj 13y ago
python -c 'print "\n".join(w or str(i) for w, i in zip(10*[None, None, "Fizz", None, "Buzz", "Fizz", None, None, "Fizz", "Buzz", None, "Fizz", None, None, "FizzBuzz"], xrange(1, 101)))'
- pudquick 13y agoNot sure I appreciate a total skipping of actually doing modulus by pre-creating the repeating 15 values but oh well, I do love me some python. python -c 'print "\n".join(w or str(i+1) for i, w in enumerate(("..Fizz..Buzz.Fizz...Fizz.Buzz..Fizz...FizzBuzz."*7).split(".")[:100]))' If you actually want to do the math, you can make your python shorter: http://stackoverflow.com/a/6890045 http://stackoverflow.com/a/6890045
- deleted 13y ago[deleted]