Realize a simple class Student
Realize a class is extremely simple .First build a file(this step is not essential in fact,but for convenience) called student.py,then start to write codes.
class Student(object):
pass
This is a class.Pass means doing nothing,which is convenient to fill codes here later.
Then we add a method init()
class Student(object):
def __init__(self, name, score):
self.name = name
self.score = score
Attention :on the both sides of init,there are two underline.
Method init() is constructor which will be transmitted automatically when instantiate object.first self stands for itself is integral.