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.
Thank you, this was very helpful for us beginners. I didn't know what objects and attributes were. Your comment above helped me alot.
Thank you so much for the hint on default value it helped alot.
I also struggled alot because I thought that ball type was a function instead of an argument.
Thank god I passed this.
I'm assuming your __init__ method looks like
__init__(self, Type): ...
Type
here is a positional argument, meaning the caller must supply it. However, in the description, it statesIf no arguments are given, ball objects should instantiate with a "ball type" of "regular."
. This should be a hint to you that a default argument is expected, i.e. the caller should be able to call your function (or class in this case, which is what __init__ does) without an argument, and the default gets supplied in this case.You need to write your function in such a way that the caller can omit "type" and deal with that case accordingly. I'd recommend reading up on python grammar for function definitions: https://docs.python.org/3.6/reference/compound_stmts.html#function
That said, use lower case for variable and parameter names, and also don't use names like "type" that are already part of python's built-ins, because you can overshadow those built ins that way, which is not what you usually want to do.
Hi I am new to coding. I am attempting this because it is 8kyu. However I am facing great difficulty attempting this question. I kept facing this error: TypeError: init() missing 1 required positional argument:"Type"
I tried to google, I saw results telling ppl to call variable with class(). However I am not sure how does it apply to my case. Maybe I am totally off from what I am thinking. So I tried follow line by line what seemed like a working example. But it still doesn't work.
Can someone give me a hint on how this should work here.