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 usinginto a clean string and print it.
"".join(...)
main.py
main.py
Ctrl + Enter