Reusables in Function

Опубликовано: 20 Февраль 2026
на канале: Nuruzzaman Faruqui
488
2

In this lesson, we will learn how to reuse a reusable part of a program as a function.

The Python code used in this lesson:

def emoji_converted(message):
separate_words = message.split(' ')
emoji = {
":)": "😊",
":(": "☹"
}
output = ""
for word in separate_words:
output += emoji.get(word, word) + " "
return output


message = input("Type your message: ")
result = emoji_converted(message)
print(result)

‘You are free to copy, edit, use and distribute this code without crediting the author. Enjoy copyright-free content.’ – Nuruzzaman Faruqui.