Created
March 10, 2025 06:57
-
-
Save 316usman/29dc53ee2e706139ffbe02861825e3da to your computer and use it in GitHub Desktop.
Dumb Test
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
def do_stuff(text): | |
words = text.split(' ') | |
# Convert all words to lowercase | |
words = [word.lower() for word in words] | |
# Trim spaces (though split already handles this well) | |
words = [word.strip() for word in words] | |
# Reverse the word order | |
words.reverse() | |
# Filter words with length greater than 5 | |
long_words = [word for word in words if len(word) > 5] | |
# Join the words with ', ' | |
result = ', '.join(long_words) | |
return result | |
# Example usage | |
text = "Hello world programming is amazing and beautiful" | |
output = do_stuff(text) | |
print(output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment