danalittleskier / murder_mystery

Python Capstone Project
0 stars 1 forks source link

Murder Mystery (PWP) #1

Open asadmehdi785 opened 6 years ago

asadmehdi785 commented 6 years ago

Criteria 1: Valid Python Code

Criteria 2: Implementation of Project Requirements

Criteria 3: Software Architecture

Criteria 4: Uses Python Language Features

Criteria 5: Produces Accurate Output

Overall Score: 19/20

Overall, excellent work with this project! You did a great job in all aspects of the project, from implementing the project requirements to using Python specific features when applicable. Good job with that!

I just wanted to point you to a string processing module that's included with Python that may be useful for certain aspects of this project, especially with the prepare_text method. There is a module called re that allows you to do regular expression operations in Python. With this module, we can actually complete what is done in the following function:

def prepare_text(text):
    prepared_text = []
    lowercase = text.lower()    
    newtext = lowercase.split()
    for word in newtext:
        strip_dot =  word.strip('.')
        strip_exclamation = strip_dot.strip('!')
        strip_question = strip_exclamation.strip('?')
        strip_comma = strip_question.strip(',')
        prepared_text.append(strip_comma)

    return prepared_text

With a single line of code instead. You can look at this resource for more information about that (you can look at the accepted answer). You can also read more about the re module here.

Great job overall! I hope you enjoyed the course!

danalittleskier commented 6 years ago

Thank you for the feedback! I was thinking there must be better way of stripping text with regular expressions. I appreciate the info on this module.

I did enjoy the course and now at least I have an intro to Python!