DeadMarshall / codecademy

codecademy courses
0 stars 0 forks source link

Missing cleanup for ',' #2

Closed sen1 closed 6 years ago

sen1 commented 6 years ago

https://github.com/DeadMarshall/codecademy/blob/6f67a46034f5b5584c9f0e26fd028b57f73e80b6/bstinsonMurder%2BMystery.py#L147-L156

You did not cleanup for the commas. Also I would suggest to lower the text first. Here is a much simpler method:

def prepare_text(text):
    lower_text     = text.lower()
    punctuation    = ".,!?"
    no_punctuation = ''.join(letter for letter in lower_text if letter not in punctuation)
    return no_punctuation.split()
DeadMarshall commented 6 years ago

fixed