Skip to content

Instantly share code, notes, and snippets.

@onlurking
onlurking / fizzbuzz.md
Last active September 6, 2016 01:01
Python FizzBuzz Oneliners
for x in ("FizzBuzz" if num % 15 == 0 else "Fizz" if num % 3 == 0 else "Buzz" if num % 5 == 0 else num for num in range(1,101)): print(x)
for x in ["fizzbuzz" if not x % 15 else "buzz" if not x % 5 else "fizz" if not x % 3 else str(x) for x in range(100)]: print(x)