You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Classes and objects/__str__ vs __repr__/task.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ defined in the object's class.
24
24
25
25
Our own defined class should therefore have a `__repr__` if we need detailed information for debugging.
26
26
Also, if we think it would be useful to have a string representation for users, we should create
27
-
a `__str__` function. Check out another approach to representing complex numbers using the `ComplexNumber` class in the code editor. Run the code
27
+
a `__str__` function. Check out another implementation of the class `ComplexNumber` in the code editor. Run the code
28
28
to see what each of the two `print` statements prints.
29
29
30
30
For more structured and detailed information, you can refer to [this Hyperskill knowledge base page](https://hyperskill.org/learn/step/7139#str__-vs-__repr?utm_source=jba&utm_medium=jba_courses_links).
0 commit comments