Discuss / Python / 交作业啦

交作业啦

Topic source

class Student(object): def init(self,name,gender): self.name=name self.gender=gender def get_gender(self): return self.gender def set_gender(self,gender): if gender=='male': self.gender='male' elif gender=='female': self.gender='female' else: raise ValueError('bad gender!')


  • 1

Reply