标签:info png __init__ elf mamicode load number imp pytho
class StudentDoc:
def __init__(self,student_number,name,major,score):
self._student_number=student_number
self._name=name
self._major=major
self._score=score
def info(self):
print(f‘{self._student_number},{self._name},{self._major},{self._score}‘)
def get_score(self):
return self._score
def change_score(self,score1):
self._score=score1
print(f‘{self._score}‘)
a1=StudentDoc(‘202013170025‘,‘Wyh‘,‘python‘,‘90‘)
a1.info()
a1.get_score()
a1.change_score(89)
a1.info()
import student
u1=student.StudentDoc(‘202013170027‘,‘Szf‘,‘python‘,‘88‘)
u2=student.StudentDoc(‘202013170040‘,‘Dj‘,‘python‘,‘91‘)
u1.info()
u1.change_score(87)
u1.get_score()
u1.info()
u2.info()
u2.change_score(85)
u2.get_score()
u2.info()
标签:info png __init__ elf mamicode load number imp pytho
原文地址:https://www.cnblogs.com/yy2dd/p/14829057.html