Ad
  • Default User Avatar

    That's the thing, they aren't. It's a culture thing :D

    People just upvote one-liners as best practice for the sole purpose that it compacts more code into a smaller space and is thus seen as minimalist or cool.

    Of course, sometimes (such as for list comprehensions or for cases where it's easier to use a built-in function) one-liners are actually best practice, but half the time, it's more likely to be someone using some esoteric, relatively niche and/or inefficient code in a one-liner.

    But it's been 11 months so you probably know by now.

  • Custom User Avatar

    one liners can be clever, but not best practice most of the time (I agree with you)

  • Custom User Avatar

    I fully agree with you. It should not be. This is not so clear especially for the beginners like me.

  • Custom User Avatar

    This is not what that means. The description means that when you are given an input like (3, 2), then your result would be 6x^1. Now in real life, an exponent of ^1 can simply be ignored, and we would just write 6x, however the kata specifically says not to truncate this (because it is an 8kyu kata), so the correct result is just 6x^1.