Last active
June 26, 2018 08:23
-
-
Save sashiyama/55edb11185485c7db19c99ebdbea24d8 to your computer and use it in GitHub Desktop.
FizzBuss one liner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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