Created
November 18, 2010 06:09
-
-
Save garydoranjr/704683 to your computer and use it in GitHub Desktop.
Prints a silly status message
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/python | |
# -*- coding: iso-8859-15 -*- | |
import string | |
import sys | |
def recurse(levels, path): | |
if levels == 0: | |
left = string.uppercase[path] | |
right = left + "′" | |
else: | |
left = '“' + recurse(levels - 1, 2*path + 0) + '”' | |
right = '“' + recurse(levels - 1, 2*path + 1) + '”' | |
return 'You say ' + left + ', I say ' + right | |
if __name__ == '__main__': | |
# Takes one argument from 0 to 4 | |
levels = int(sys.argv[1]) | |
print recurse(levels, 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment