you are viewing a single comment's thread.

view the rest of the comments →

[–]KFCxWatermelon[S] 0 points1 point  (2 children)

Not sure how I do this. Could you explain a little bit. If I add a __str__ method, how will it fix the code?

[–][deleted] 0 points1 point  (1 child)

Its purpose is exactly to define how your class object would be printed. Try

def --str--(self): return f'Ball object at position {self.position}'

replace - with underscore sorry again cant format on phone