Skip to content

Instantly share code, notes, and snippets.

@316usman
Created March 10, 2025 06:57
Show Gist options
  • Save 316usman/29dc53ee2e706139ffbe02861825e3da to your computer and use it in GitHub Desktop.
Save 316usman/29dc53ee2e706139ffbe02861825e3da to your computer and use it in GitHub Desktop.
Dumb Test
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