Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Regular Expressions in Python Introduction to Regular Expressions Escapes

"Task 1 is no longer passing", but I did NOT even change it

Can someone please shed some light on this one. I'm trying to solve Task 2 of 2 of the Code Challenge on Regular Expressions. Task 1 has already passed, and I didn't change it. Then, I submit my code for Task 2, but I'm getting this weird error given in the subject line above. Thanks for any insights you can provide.

escapes.py
import re

def first_number(any_str):
    return(re.search(r'\d ', any_str))


def numbers(count, some_string):
    result = (re.search(r"\d" * count, some_string)
    return result

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 67,989 Points

A previous task may fail if a new syntax error is introduced anywhere in the code. It looks like there is a missing right paren in the second function.

Shijie Huang
Shijie Huang
2,184 Points

I have the same problem like Conrad. But I can not find the missing right paren. Can you give me extra advice about the second function.

Thanks Chris, I added the missing right paren at the end, and it finally passed. However, that error "Task 1 is no longer passing" was really misleading. :-)

Chris Freeman
Chris Freeman
Treehouse Moderator 67,989 Points

Everyone hits this at sometime. So now you know. ?

When there is a syntax error the checker isn't sophisticated enough to figure out what caused it. It simply runs tests for all the tasks so a Task 1 test will always fail first on a syntax error.