Ad
  • Custom User Avatar
  • Custom User Avatar

    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 states If 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.