Ad
  • Custom User Avatar

    So, this kata just doesn't apply to the Python language - do I get that correctly? Sorry for the trouble. I am just confused. I kind of see why it wouldn't apply to Python because I didn't translate the kata as it is, but changed a part of it.

  • Custom User Avatar

    What translation?

  • Default User Avatar

    I'm awfully tempted to take the liberty of pressing that red reject button. Both the problem and the solution doesn't apply to python. It does not translate. This translation shouldn't exist.

  • Custom User Avatar

    "In Python, strings are provided instead of bytes, as Python lacks a 'byte' data type, unlike some other programming languages."

    The modified paragraph provides a brief explanation of why Python uses strings instead of bytes, making it clearer for readers who may not be familiar with the differences in data types between programming languages. This additional clarity enhances the informativeness of the text.

  • Custom User Avatar

    Oops, I'll mark this as solved then. :

  • Custom User Avatar

    those are swapped, as already reported below (years ago)

  • Custom User Avatar

    area_code: Returns an area code from the number. The area code will be 3 digits.

    Yeah, sure.
    I'm not extremely sure what's wrong here, though. It may be that expected and actual are swapped, or it's just that the kata is broken.

  • Custom User Avatar

    Tests are not actually displaying the expected answer.
    '1234567890' should equal <bound method Phone.number of <solution.Phone object at 0x7fa358dfd5e0>>
    Please fix.

  • Custom User Avatar

    Marking it as solved, already did both.

  • Custom User Avatar

    Marking it as solved because it's no longer in the kata.

  • Custom User Avatar

    Added

  • Custom User Avatar

    The value it returns is b, of course, but the reference it returns is a. This matters if a is an object or a property of one.

    I can't tell you offhand why your solution isn't working; possibly the mechanism is different within a setter. But, frankly, I think that's your problem. If I knew, I would gladly tell you, but seeing as I don't, I'm not making your problem mine. Both Alex' and my solution handle this correctly, as far as I can see, so it's not impossible.

  • Custom User Avatar

    Not sure how this would be possible, I tried to return the expression itself but that doesn't work.
    Also, a = b returns b and not undefined, or am I missing something?

  • Custom User Avatar

    Fixed the description.

  • Custom User Avatar

    a = b should return a ( with its new value ) in JS. The reference solution doesn't seem to do this and I haven't checked if this is tested. Existing programs sometimes rely on this; it is not good practice to return undefined for this expression even if the side effect is handled correctly.

  • Loading more items...