Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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 :).
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.
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
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?
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.
Perhaps I should indeed!
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.
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.
This comment is hidden because it contains spoiler information about the solution
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!