Last active
December 19, 2015 06:29
-
-
Save 0xBADDCAFE/5911692 to your computer and use it in GitHub Desktop.
in computer_science room(#Lingr).
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
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