Level 5 : What will be the output of the following Python code?


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

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