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