def __str__(self): will be used when you try to str(my_object). It would also be called in string interpolation such as f'This is my object: ...
確定! 回上一頁