Tell us what’s happening:
The output of this code is as expected, but the execution is not passing through.
Your code so far
# User Editable Region
return re.sub('(?<!\d)1x', 'x', equation_string.strip('+'))
# User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:131.0) Gecko/20100101 Firefox/131.0
Challenge Information:
Learn Interfaces by Building an Equation Solver - Step 35
Modify your regex pattern to use a negative lookbehind so that the character 1
is substituted only if not preceded by a digit.
Looks good, but where did those x’s come from? They are not mentioned in the instruction.
here, I am replacing 1x with x
Is that part of the instructions?
That’s wrong: 11x became 1x and then passed the test. That’s weird.
If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.
The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.
Thank you.