Skip to content

Instantly share code, notes, and snippets.

@daniel-schroeder-dev
Created August 21, 2021 21:21
Show Gist options
  • Save daniel-schroeder-dev/6ffff19d0714484f0c216fb5f3f56f50 to your computer and use it in GitHub Desktop.
Save daniel-schroeder-dev/6ffff19d0714484f0c216fb5f3f56f50 to your computer and use it in GitHub Desktop.
Elijah
import random
sentences = ("I forgot the colon in the if statement.", "I'm Drunk!", "Don't Do Drugs")
for sentence in sentences:
words = sentence.split()
randomWord = random.choice(words)
new_sentence = ""
for word in words:
# if the word is the randomWord, hide it
# otherwise, add the word to the new sentence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment