0

I am writing a code that finds a character in a string; then if the character is in the string it replaces the character with a new character e.g an emoji.

Here is my code.

def main():
    text = input("Text: ")
    face = convert(text)
    print(face)

def convert(text):
    if text.find(":)") != -1:
        text.replace(":)", "")

    if text.find(":(") != -1:
        text.replace(":(", "")

main()

I expected an input of " Hello :)" to output "Hello "; sadly it output "none"

Balup
  • 5
  • 5

0 Answers0