Ad
  • Default User Avatar

    I think the point was that can_move and damage ought to be read-only properties, hence why getters are used in JavaScript. The @property decorator could have been used to that effect in Python, too bad it was not done

  • Custom User Avatar

    Concepts are correct, names are wrong. Nothing to be done about it though.

    Closing.

  • Default User Avatar

    Thanks a lot for the help, i was able to complete the one you suggested, but i'm still puzzled by this one !

  • Custom User Avatar

    In Python, the argument called sperm can take the value XX or XY: this is incorrect, as sperm usually only have a single sex chromosome. The parameter should be renamed.

    sperm is now named chromosome in the Python translation.

    There are more cases than XX and XY, they shouldn't be left ignored.

    This isn't a biology class, it's a simple code challenge for beginners.

    Linking sex to gender may be clumsy.

    ...

  • Default User Avatar

    I didn’t realize that it could be in Python 2. Now it’s clear, thank you!

  • Default User Avatar

    The issue is still partially reproducible. Python version has starting code now but inconsistency with description is still there.

    • description: "Tank: has a state, canMove and damage properties"
    • actual checks: "Tank: has a state property, can_move and damage methods"
  • Custom User Avatar

    Everything is working correctly.

  • Custom User Avatar

    I agree. head in my head is, in a sense, a way to reference a previous node.
    Since this is a Singly Linked List, any particular Node has a reference to the next Node only. So it's tail is always traceable but not it's head.

    Given: N1 -> N2 -> N3
    For the entire list, head should always point to N1 and tail should always point to N3.

    But when we look at any one particular Node, we can access data and next.
    Now, head would be the Node itself and tail would be next.
    So in push(head,data), it literally translates to node.next = head, which is really confusing.

    I may be wrong in thinking this way so any help would be appreciated.