Created
July 18, 2023 18:46
-
-
Save aaronsbytes/4280dd8e6c1d6a0f4a6993759e818dd1 to your computer and use it in GitHub Desktop.
python text to uwu function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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