Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save YangHgRi/01cccf16aebfbb8961f8ea3f9e13398c to your computer and use it in GitHub Desktop.
Save YangHgRi/01cccf16aebfbb8961f8ea3f9e13398c to your computer and use it in GitHub Desktop.
i'm learning python :)
def mood_converter(message):
word = message.split(' ')
my_mood_tuple = {'happy': ':)', 'sad': ':('}
output = ''
for message in word:
output += my_mood_tuple.get(message, message) + ' '
return output
message = input('>')
print(mood_converter(message))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment