W1Q9: The Reason You Get 2 Test Failed

I thought I’d like to share my process on question 9.

Check that the allow_switches have been accounted. It’s not about switching =True or =False either as I am sure you have been through a few tries of those.

You just simply need to code the logic of the parameter:

  • If true concatenate the output of switch_letter() to your suggestions

  • if not then don’t

The 2 tests that didn’t pass were the results of you not implementing this logic in edit_one_letter and edit_two_letter

I decided to put this on here because the explanations I saw in this forum kept going over the point.

Have a good day!

1 Like

Hi @ice_ruttanan,

Thank you for sharing your insights.

Mubsi

I have taken into consideration the allow_switches parameter. This helped me pass one more test than the 18 like before. I have included the code for allow_switches in both edit_one_letter and edit_two_letters.
Did you run into this problem?
I was frustrated and brute-force the code for quite some time haha.

Could you please message me the code? I think it has to do with the logic of the code but I can’t be too sure.

1 Like

Hi @ice_ruttanan, maybe you can help me…

I have conctenated switch_letter() in edit_one_letter and in edit_two_letters I call edit_one_letter and then interate over the result of edit_one_letter again, so my question is, why should I use switch_letter() in edit_two_letters?

Basically, switch_letter() in edit_two_letters() expands the set of edits ‘switch-wise’ for your input. Although, as stated by the instruction, the Boolean parameter was given because switch is the least common edit method.

I hope this is the answer you’re looking for.