PyNotes
261 subscribers
125 photos
7 videos
1 file
60 links
**Code is communication**
admin: @Xojarbu
https://t.me/solutions_py for problem solutions
Download Telegram
#class #methods
Title: __repr__ with __str__


—When we call Class it is represented by __str__ method by default, if there is not __str__ method, __repr__() method will be called.
—The __repr__() method returns the code representation of an instance, The __str__() method converts the instance to a string

! A good example is provided above

source: "Python Cookbook: