Skip to content

Instantly share code, notes, and snippets.

@junichiro
Created January 28, 2015 02:51
Show Gist options
  • Save junichiro/9c7955db2c07c5631bbe to your computer and use it in GitHub Desktop.
Save junichiro/9c7955db2c07c5631bbe to your computer and use it in GitHub Desktop.
code_iq: 1236
# -*- coding: utf-8 -*-
class code_iq:
def do(self, n):
res = []
for v in range(1, n + 1):
if v % 3 == 0 and v % 5 == 0:
res.append('Fizz Buzz')
elif v % 3 == 0:
res.append('Fizz')
elif v % 5 == 0:
res.append('Buz')
else:
res.append(v)
print ", ".join(map(str, res))
if __name__ == '__main__':
code = code_iq()
code.do(100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment