say I have a user-defined class class records: def __init__(self): self.name = '' self.gpa = 0.0 student = recards() student.name = 'John' student.gpa = 3.0 I want to 'print student' to be ['John',3.0] what shoud be done? Thanks!
【在 g****a 的大作中提到】 : say I have a user-defined class : class records: : def __init__(self): : self.name = '' : self.gpa = 0.0 : student = recards() : student.name = 'John' : student.gpa = 3.0 : I want to 'print student' to be ['John',3.0] : what shoud be done? Thanks!
【在 g****a 的大作中提到】 : say I have a user-defined class : class records: : def __init__(self): : self.name = '' : self.gpa = 0.0 : student = recards() : student.name = 'John' : student.gpa = 3.0 : I want to 'print student' to be ['John',3.0] : what shoud be done? Thanks!