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 trialOndina Lipsa
368 PointsAssertion Error...
Hello, can you please tell me why my code doesn't work?
# insert your code here
my_tuple='I','love','python'
1 Answer
boi
14,242 PointsAh, the good ol regex. Seems like to check your solution regex is used in the back. You'll learn about regex soon.
Coming to the error displayed *AssertionError: Regex didn't match: 'my_tuple\s=\s[/(]?\'?\"?I\"?\'?,\s\'?\"?love\"?\'?,\s\'?\"?python\"?\'?[/)]?' *.
notice that my_tuple
have \s
before and after the equals sign, \s
means space, so try this;
my_tuple = 'I', 'love', 'python'
Give a space before, after the equals sign, and after every comma.
Ondina Lipsa
368 PointsOh yes, thank you so much, it worked!
Ondina Lipsa
368 PointsOndina Lipsa
368 PointsTraceback (most recent call last): File "", line 22, in test_code_expectations AssertionError: Regex didn't match: 'my_tuple\s=\s[/(]?\\'?\"?I\"?\\'?,\s\\'?\"?love\"?\\'?,\s\\'?\"?python\"?\\'?[/)]?' not found in "my_tuple=('I','love','python',)" : To create a tuple, my_tuple should be equal to comma separated values. You can also use parentheses around the values if you want.