Created
May 1, 2014 16:23
-
-
Save jProvim/263ae6403ca5f1702a43 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
import sys | |
CASE1 = 1 | |
CASE2 = 5 | |
CASE3 = 7 | |
WORD1 = 'Fizz' | |
WORD2 = 'Buzz' | |
WORD3 = 'Whizz' | |
def filter(num): | |
if str(CASE1) in str(num): | |
print(WORD1) | |
return | |
if num % CASE1 == 0: | |
sys.stdout.write(WORD1) | |
if num % CASE2 == 0: | |
sys.stdout.write(WORD2) | |
if num % CASE3 == 0: | |
sys.stdout.write(WORD3) | |
def main(): | |
filter(int(raw_input('Please input a number: '))) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment