Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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 68,441 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 68,441 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.