Beispiel #1
0
from c1 import Student

student = Student('afs', 2)
student.print_file()
student.do_homework()
Beispiel #2
0
"""  """
from c1 import Student


#实例化
student = Student('tony','男',18)
print(student.print_file())
#由此可见__init__方法在实例化对象执行时可以自动调用构造函数,并且可以被显示调用
Beispiel #3
0
from c1 import Student
stu = Student()
stu.print_file()
Beispiel #4
0
from c1 import Student

zhangsan = Student()
zhangsan.print_file()
Beispiel #5
0
from c1 import Student

s = Student()
s.print_file()