Ad
  • Custom User Avatar

    Thanks for the clarity! I guess it didn't make sense to me why the test cases were calling an instance variable instead of a method? Got it straightened out now :).

  • Custom User Avatar

    In Python, "ball_type" is an instance variable not a method. You need to change "ball_type" so that it is set to the "type" parameter.

  • Custom User Avatar

    It appears the test cases for Python are broken? The method call after Ball(). is missing the required (). This is causing it to only return an object and not the desired output.
    The below is an entirely valid and common solution to such problems, yet it's not an option because of improper test cases.
    For example:

    class Ball(object):

    def init(self, type='regular'):
    self.bt = type

    def ball_type(self):
    return self.bt

  • Custom User Avatar

    I actually haven't had an issue with the ReferenceError. However, I am having an issue passing the 30 numbers test case EVEN THOUGH my output is exactly the same as what is expected by the test case (Python 3.4) which makes no sense to me. Has anyone else run into a similar issue?

  • Custom User Avatar

    I have tried to complete this kata using both Python and Javascript -- both of which appear to be broken. Javascript seems to also have some incorrect test cases.

  • Custom User Avatar

    Perhaps I should indeed!

  • Custom User Avatar

    Perhaps you should start looking at functional programming (especially first-class functions) and why it's important and useful. Almost all the classical (mainstream) languages have adopted and implemented it, so it must have very important uses :P

    Also, no, callback hell is another thing, which has already been eliminated with ES6 Promises. It's been pretty much obsolete.

  • Custom User Avatar

    Why would I ever want my function to return another function instead of just returning the result. Isn't this the gateway to the so called "callback hell"? The approach utilized here doesn't make sense to me at all. IS there a real world use case where this approach is preferential? It just seems like redundant programming to me.

  • Custom User Avatar

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

  • Custom User Avatar

    Unless I'm missing something, it appears you're using Python 3 code since Python 2.7 does not have a Statistics module like you've imported in your code. Python 3 does not appear to be available for this kata, at least not for me!