The class student:
Def __init__ (self, value, next=0) :
self.value=https://bbs.csdn.net/topics/value
The self. The next=next
Def the __str__ (self) :
Value) return int (self.
CodePudding user response:
Doesn't have to STR, see what you find out, but a broader, STR you generated is not a number, for example, int or float will go wrongCodePudding user response:
One thousand some of you cannot convertCodePudding user response:
Python is based on the agreement. Both __init__ and the __str__ or calculation length __len__ is a protocol, a kind of informal interface, need to abide by. If you use the int or float, users in the use of your class, there will be a puzzling error.