python class类
#!/usr/bin/python3 class Student(object): def __init__(self): #默认有此函数,自定义时运行自定义的。实例化时首次运行该函数 print("First function to run when create a instance.") def getName(self): self.name = input("input your name:") def showName(self): print("your name is:", self.name) boy = Student() boy.getName() boy.showName()