I've seen the term __str__
used a lot within classes in Python. I've tried to look up what it means and its functions but many websites teach it in relation to the Java function toString
or __repr__
. As I don't come from a Java background, its hard for me to learn it that way. I've also seen people compare it to the function str()
but I don't know how accurate that is or in what ways.
Could someone explain it to me in simple terms? Thanks.