I had trouble earlier in this lesson when first asked to refactor a case statement. The program ran. I walked through every line to make sure there weren’t any typos. There wasn’t an error, but after a prolonged execution period of the answer being checked, my answer was marked as incorrect.
I went back and replaced all the quotes in case there was a character encoding issue. I then switched the case statement from compact to expanded (instead of using ‘then’ to compress to a single line as either answer was acceptable). The program still ran as expected, but the answer was still marked wrong.
I eventually gave up and allowed the system to input its own solution. The only difference I noticed was extra lines being skipped between the comment and the custom code.
But again, I am running into the same problem with a question further in the lesson (In Case of Many Options).
The program runs as expected. I made only minimal edits to the original code, so there shouldn’t be any character encoding issues. The execution takes an extended period (at least 45 seconds of processing/thinking) before marking my answer as incorrect.
Can anyone tell me what I’m doing wrong?
Oh, and I have tried using both double-spacing and tabbing to indent the code, as well as not indenting, in case there was a nuance with the backend test.
I don’t want to skip this question like the last one as I keep hitting a wall with the case statements in this lesson and am obviously making a mistake that I need to learn from. Please, help.