31 Years of Python | 48 Hour Sale Extension!!!

354-11: Solution given doesn't match all occurrences of "Email"

Screen Link:

My Code:

r"\be[ -]?mails?"

What I expected to happen:
I expected my solution would be accepted.

What actually happened:
The parser indicated I had 2 too many matches. Upon examining the data further, I find that the solution given will only match if one of the patterns specified in the table is followed by a word boundary. There are two titles that have the word “Emailing.” I don’t see any indication in the instructions for this exercise that those two should not be matches.

More Details
Assignment: We’ll finish this lesson by writing a regular expression and count the number of times that email is mentioned in story titles.
Titles not matched by the official solution:

13943    Why That Salesperson Just Wont Stop Emailing You
14161    Emailing SaaS companies to test support time

I am not saying that the answer provided is wrong, but the instructions are ambiguous.

Hi @juneappal ,

You’re right. But at times, in some lesson screens the focus has been given to practicing what we have learned up to that point. Word boundary and ignoring the cases are in focus I believe. That could be the reason why a certain solution has been written. But you can always inform the team regarding a better solution whenever you come across one.

Could you please share your feedback with the Content & Product teams of Dataquest? Just click the ? button in the upper-right corner of any screen of the Dataquest learning platform, select Share Feedback, fill in the form, and send it. Thanks!

1 Like

A very much relevant thought is shared here.

1 Like

The difference is that in that other exercise the goal is clear, and the regex is tricky. In this exercise ( 354-11) it’s not difficult to set up the regex to function either way. The issue is that the problem statement seems to suggest that “emailing” should be a match.

Although it should definitely be clearer, I disagree that it suggests what you say. I actually think it suggests what the solution expects. I think the author is looking for the noun “email”, not strings that contain this word (and its variations).

I suggest you follow this suggestion for us to have it fixed. Thanks!

Using the word “noun” in the assignment would make that more clear.

BTW: In 369-7 similar language is used, (“Let’s use the same technique to make all the different variations of “email” in the dataset uniform.”) but the solution given DOES replace “Emailing” with “email.”

I will submit a link to this discussion through the feedback badge. At very least these two exercises should be consistent. Even better would be if they were explicit about whether only nouns are to be matched.

1 Like