Skip to content

Instantly share code, notes, and snippets.

@0xBADDCAFE
Last active December 19, 2015 06:29
Show Gist options
  • Save 0xBADDCAFE/5911692 to your computer and use it in GitHub Desktop.
Save 0xBADDCAFE/5911692 to your computer and use it in GitHub Desktop.
in computer_science room(#Lingr).
def fizzbuzz_t(n):
'''
Return "fizzbuzz" value by tuple.
Examples:none.
'''
a_tuple = ()
for i in range(1, n+1):
if i % (3 * 5) == 0:
a_tuple += ('fizzbuzz',)
elif i % 3 == 0:
a_tuple += ('fizz',)
elif i % 5 == 0:
a_tuple += ('buzz',)
else:
a_tuple += (i,)
return a_tuple
if __name__ == '__main__':
import doctest
doctest.testmod()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment