Skip to content

Instantly share code, notes, and snippets.

@ldong
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ldong/65b00804b138e1a802dd to your computer and use it in GitHub Desktop.
Save ldong/65b00804b138e1a802dd to your computer and use it in GitHub Desktop.
#!/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