Source Code:
(back to article)
class MyClass: def __init__(self, value): self.value = value def __str__(self): return str(self.value) obj = MyClass(10) print(obj) # will print "10"
Result:
Report an issue