It's not uncommon for a data type to have specific requirements. Just because Python uses ", " in its representation of list and tuple doesn't mean everybody needs to do this.
And yes, the description makes the __str__ method part of the task, so one has to implement it. (It's not that hard, BTW.)
I believe you mean
str()
funciton.you can have variable named
str
It's not uncommon for a data type to have specific requirements. Just because Python uses
", "
in its representation oflist
andtuple
doesn't mean everybody needs to do this.And yes, the description makes the
__str__
method part of the task, so one has to implement it. (It's not that hard, BTW.)