3.classier classes
remove the pass statement in your class definition,then go ahead and define an init__() function for your Animal class.
pass it the argument self for now.
finally,put the pass into the body vof the init() definition.since it will expect an indented block.
class Animal(object):
def init(self):
pass
init兩邊都是雙劃線挑辆,在電腦上和手機上都看不出來矿辽,在問答里面找到了這個知識點士复。電腦和手機上的兩條下劃線看起來就像一條鹦付。
2.class
create a class called Animal in the editor.for now,in the body of your class use the pass keyword.(pass doesn't do anything ,but as a placeholder in areas of your code where python expects an expression)
syntax:
class NewClass(object):
class Animal(object):
pass