Merge Sort: review

Hello, I have a question about the very last step of

The instruction is as follows.

In , we included your code from the last exercise. If you’re up for the challenge, see if you can combine the two lines in your if and else blocks into one line to make your code look a little cleaner.

I need some hints (NOT the solution code though). I am browsing in the Internet and I found out that one could combine multiple “if” lines with switch, enum or other similar solutions. Am I supposed to apply these solutions to this step too?

I can’t see the code because I haven’t completed that lesson yet, though I have in the python course. I’m guessing the ternary operator would be the simplest way to turn it into a one liner. Personally I don’t like ternary operators because I find they make the code harder to read, but that’s just me.

1 Like