Created
August 29, 2018 14:48
-
-
Save alicerunsonfedora/00dcf0862e0ef35cabb45e61164c082f to your computer and use it in GitHub Desktop.
Greeter
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
# Greeting.py | |
# A greeting generator | |
# (C) 2018 Marquis Kurt. | |
def get_greeting(greeting_list): | |
""" | |
Gets a greeting from a list and generates a message | |
:param greeting_list: The array with the string components of a message | |
:returns: A concatenated string of the array | |
""" | |
greeting_message = "" | |
for item in greeting_list: | |
greeting_message = greeting_message + item | |
return greeting_message + "!" | |
if __name__ == "__main__": | |
greeting = ["o", "h", "a", "y", "o", "u"] | |
print(get_greeting(greeting)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment