Skip to content

Instantly share code, notes, and snippets.

@aaronsbytes
Created July 18, 2023 18:46
Show Gist options
  • Save aaronsbytes/4280dd8e6c1d6a0f4a6993759e818dd1 to your computer and use it in GitHub Desktop.
Save aaronsbytes/4280dd8e6c1d6a0f4a6993759e818dd1 to your computer and use it in GitHub Desktop.
python text to uwu function
# For the senior devs
def text_to_uwu(input_string: str) -> str:
words = input_string.split()
processed_words = []
for word in words:
if word.endswith("u") and len(word) > 1:
word = word[:-1] + "uwu"
word = word.replace("r", "w")\
.replace("l", "w")\
.replace("ne", "nye")
processed_words.append(word)
processed_string = " ".join(processed_words)
return processed_string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment