Skip to content

Instantly share code, notes, and snippets.

@sashiyama
Last active June 26, 2018 08:23
Show Gist options
  • Save sashiyama/55edb11185485c7db19c99ebdbea24d8 to your computer and use it in GitHub Desktop.
Save sashiyama/55edb11185485c7db19c99ebdbea24d8 to your computer and use it in GitHub Desktop.
FizzBuss one liner
import re
def fb(x):
return re.sub(r'[0-9]+', '', str((['Fizz'] + list(range((x % 3))))[x % 3]) + str((['Buzz'] + list(range((x % 5))))[x % 5]))
i = 1
while i <= 200:
print(i, fb(i))
i = i + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment