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.
In questa pagina del sito puoi guardare il video online Reusables in Function della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Nuruzzaman Faruqui 25 settembre 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 488 volte e gli è piaciuto 2 spettatori. Buona visione!