Ad
  • Custom User Avatar

    @Kacarott, thank you for acknowledging this. I would probably have realized that it requests a list if I had looked closer to the expected output or the tests, but I usually don't look at tests unless I get a failing test, and the result I got was not a failed test but an error in the code (That was what was frustrating because the code had no errors). And because I am an instruction follower, I can easily dismiss a missing parenthesis in the ([]) sequence. Your solution looks clever to me. Thanks.

  • Custom User Avatar

    Yeah, arrays in Python have been around for ages. The issue of python authors mislabelling lists as arrays has probably been around just as long. For newer kata, this should come up during the beta process/translation review, but it exists in a lot of older ones.

    As for descriptions, array should just be read as a general "sequence" data type, since making descriptions very language specific is quite a hassel.

    However in my opinion, the initial solution in Python should definitely refer to elements as lists, not arrays. Reading "array" in the description, but then seeing the argument named "lst" in the initial solution reassures that the input is indeed a list. However seeing the argument named "array" is more confusing, and also misleading to newer users.

  • Custom User Avatar
  • Custom User Avatar

    There is allways a first time. The reason there haven't been complains about this is perhaps that this is a basic level test. And a python beginer might not know the difference between a list and an array. But the concept of array (if not the class) exists since python 2.7: https://docs.python.org/2.7/library/array.html

  • Custom User Avatar

    Sorry for your head, but really I don't think it's going to happen on the hundreds, maybe thousands of katas refering to arrays. I've never seen a kata expecting an array, I didn't even know it existed, and I've never seen anyone complaining about that.

  • Custom User Avatar

    I am new to katas but not new to python. And I spent a long time banging my head on the error I was getting, cos it was not very helpfull and I was doing what the instruction told me to. So changing the description to list of numbers instead of array might work, or at least making a note to python users.

  • Custom User Avatar

    I've just learnt Python has arrays since 3.10 (so very recently). Well, I don't know what to tell, I have never seen yet a kata expecting arrays outputs... Probably we should rely on a framework update that would handle this properly. Until now, you would better return lists...

    Still, vrx was refering to numpy.arrays.

  • Custom User Avatar

    thas is not true. the datatypes array and list are different: https://docs.python.org/3/library/array.html

  • Custom User Avatar

    In Python, an array (generic programming term) is implicitly a list (probably the most common data structure), not a numpy.array, which is a very specific data structure.

    There are no data structures named arrays in Python, the descriptions are generic and don't give all the possible details for the tens of available languages.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution