Last active
September 9, 2016 20:11
-
-
Save jtallieu/8baa2c96289cc4542802dcef007f1e9b to your computer and use it in GitHub Desktop.
Eagle Eye Networks Inc :: Python screening - Debug I
This file contains hidden or 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
""" | |
::Eagle Eye Networks Inc.::: | |
::Python screening:: | |
The following script is purposley written poorly. | |
Fix the 'magic' function. | |
""" | |
def magic(X, additional=[]): | |
""" | |
Combine the letters of the word X, with the | |
optional additonal letters and print them | |
in alphabetical order | |
""" | |
chars = list(X) | |
# Combine the characters and the | |
# additional letters if there are some provided | |
additional += chars | |
# Sort | |
additional.sort() | |
print "".join(additional) | |
if __name__ == "__main__": | |
magic('eagle', list('eye networks')) | |
magic('eagle') | |
magic('eagle') | |
magic('video') | |
magic('eagle', list('video')) |
Author
jtallieu
commented
Sep 9, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment