3 ответов
+ 5
it should be,
class childClass(parentClass) :
#code here
now child class is derived from or inherited from parentClass.
+ 4
class A(object):
pass
class B:
pass
print(A.__bases__)
print(B.__bases__)
# https://stackoverflow.com/questions/4015417/JUMP_LINK__&&__python__&&__JUMP_LINK-class-inherits-object
+ 1
You need to create the object of the class and use it. like this.
x=ClassName(properties)
print(x.propertyname)
Here x is the object of the class. whose Name is ClassName