toString()
for our own class, is there an equivalent thing in Python?The answer is ... YES!
Just by redefining an special "
__str__(self):
" method in your own class, you can have your own human-readable string representation of your class object! What a beauty!
No comments:
Post a Comment