Back to Lesson

Data Scrubbing

Clear undesirable fragments immediately.

Instructions

  • Given
    sentence = "Hello! Python is totally #awesome?"
  • We want to remove punctuation. Specifically:
    "!", "?", "#"
    .
  • Use a list comprehension to discard any character in
    bad_chars = {"!", "?", "#"}
    .
  • Rejoin the list using
    "".join(...)
    into a clean string and print it.
main.py
main.py