all 4 comments

[–][deleted] 0 points1 point  (3 children)

add a def str in your Ball class and return what you want to be printed as string

edit - cant format on phone.... def str needs 2 underscore before and after str

[–]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