tostring

Confused about __str__ on list in Python

Confused about __str__ on list in Python Question: Coming from a Java background, I understand that __str__ is something like a Python version of toString (while I do realize that Python is the older language). So, I have defined a little class along with an __str__ method as follows: class Node: def __init__(self, id): self.id …

Total answers: 8