Level 1 : what is the output of the following code.


class A():
    def disp(self):
        print("A disp()")
class B(A):
    pass
obj = B()
obj.disp()

Author: Devakanth | Tags: inheritance | 1736+ Python FAQs | Share
counter | virtual-environment | deep-copy | fabs-function | enumerate() | loop-control | bitwise | file-handling | destructor | feature | round-function | syntax-error | global-keyword | debugging | scientific-notation | id-function | python-django | filter-function | heap-memory | sorted | arithmetic-operation | else-statement | filter | classes | map-function | matrix | collections | generators-in-python | while-else-loop | mathematical-function | identity-operator | precedence-and-associativity | loop | return-statement | virtual-environment | max-min | version | __all__-attribute | exponentiation | bitwise-operator | function-argument | command-line-parsing | comment | lists | python-repl | memory-management | join | control-flow | expand-tab | comprehension | boolean-and-non-boolean | identifier | data-type | overflow | round | gil | datetime | objects | numpy | built-in-function | dictionary | min-function | raise | oop | assert | odd-number | min-max-function | boolean | tuple | threading | methods | logical-operator | postfix | init | built-in | default-mutable-argument | matrix-list-comprehension | generator | list-indexing | keyword | pandas | math-copysign | control-statement | type-conversion | staticmethod | logical-operator | while-and-for-loop | datatype | string-manipulation | regex | string-iteration | floating-point-precision | list | binary-operation | installation | class-and-object | condition | data-structure | file_handling | encoding | class | oops | access-modifier | object-attribute | data_structure | match | global-variable | iterator | __future__ | touples | design-principle | namespace | sorting | complex-number | operator-and | call | application | yield | attribute | arithmetic-expression | pickling-&-unpickling | zip | identity-operator | error | iterable | functions | goto-function | turtle | file | dicts | split | complex | choice | indexing | random-function | immutable-data-type | factorial-function | invalid-list | list-join | int | indentation | inheritance | immutability | exception | conditional-statement | syntax | inherit | typeerror | higher-order-function | operand | namedtuple | python-history | dictionaries | multiple-inheritance | input-function | string-method | operators | string-slicing | name-mangling | control-flow | string-slicing | module | mutable | library | escape-operator | sum-function | operator-or | bitwise-operator | descriptors | range | comparison | sys-module | expression | array | generators | sys | with-statement | asyncio-module | built-in-function | list-mutation | collection | data-type | stack | syntaxerror | format | version-check | counter-function | integer | type_conversion | function-and-scope | list-vs-tuple | zip-function | head-and-tail | __init_subclass__ | loops | numeric | functional-programming | print-statement | encapsulation | thread | software-design | exception-handling | list-comprehension | decorator | lambda-function | set-operation | multiprocessing | decimal | recurssion | mapping-function | package-management | magic-method | python_version | class-and-inheritance | multithreading | list-slicing | list-operation | docstring | lambda | recursion | mysql | python | formal-and-actual-parameter | math | tuple-unpacking | regular-expression | conversion | matplotlib | syntax-error | string-concatenation | frozenset | operations | string-method | update | pseudocode | async | parameter | slice | input | slicing | benefit | interpreter | import-method | data-structure | precedence | data-structures | memory | asyncio | type-conversion | center | global-variable | implementation | method | for | list-method | operator-overloading | assignment-operator | rollback | statement | random | print | swapping | input-function | sum() | list-comprehension | nested-loop | compute | lambdas | class-and-instance-variable | basic | mathematics | exception-handling | pep | python-module | string-formatting | file-handling | error-handling | def | string-formatting | while-loop | static-method | shallow-copy | global | string | copy | set | operator | constructor | conditional-statement | binary | function | append | logical-operation | polymorphism | variable | context-manager | zfill-function ...