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 | 1859+ Python FAQs | Share
namedtuple | tuples | list-method | list-methods-and-slicing | managing-directories-with-os-and-shutil | logical-operation | module | loop-control | math | array | datatype | matrix-list-comprehension | math-copysign | decimal | loops | list-operation | dictionary-methods | multithreading | __future__ | min-function | dictionaries | method-overloading | logical-operator | memory-management | mathematics | boolean-and-non-boolean | memory | matplotlib | walking-through-directories-using-os.walk() | working-with-temporary-files-using-tempfile | built-in-function | sets | decorator | descriptors | higher-order-function | comparison | logical-operator | working-with-file-paths | data-types | debugging | list-slicing | assignment-operator | type-conversion-and-casting | indexing | multiple-inheritance | exception-handling | data-type | loop-control-statements | counter | file-handling | collections | list-vs-tuple | regular-expression | mysql | assignment-operators | thread-synchronization | sys | list,-set,-and-dictionary-comprehensions | exception | bitwise | input-function | global-variable | list-comprehension | formal-and-actual-parameter | attribute | literal-characters-and-special-characters | inheritance | format | implementation | fabs-function | list | matrix | comprehension | magic-method | encoding | class-decorators | docstring | async | conditional-statement | installation | tuple-unpacking | syntax | iterators | list-mutation | anchors-(^,-$) | lists | regex | lambda | methods | keyword | using-assertions-(assertequal,-assertraises) | using-map()-for-transformations | binary | zip-function | append | multiple-inheritance | datetime.date,-datetime.time,-datetime.datetime | data-structure | escape-operator | min-max-function | python-history | error-handling | with-statement | arbitrary-arguments-(*args,-**kwargs) | access-modifier | assert | expression | bitwise-operator | operator-and | name-mangling | writing:-write(),-writelines() | enumerate() | multiple-except-blocks | raise-statement | built-in-modules | loop | using-yield-in-functions | exception-handling | data-type-conversions | while-loops | list-comprehension | mutable | floating-point-precision | def | stack | string-manipulation | nested-loop | python-repl | functions | threading | floats | file | single-inheritance | recurssion | reading-and-writing-files | lambdas | built-in | library | global-variable | interpreter | string-methods | string-iteration | static-method | pandas | pep | for | identity-operator | string-formatting | indexing:-loc-vs-iloc | map-function | virtual-environment | update | else-statement | control-statement | list-comprehensions | while-and-for-loop | lambda-functions | immutable-data-type | data_structure | tuple-methods | generator | collection | round | scientific-notation | immutability | arithmetic-operation | split | quantifiers-(*,-+,-?,-{}) | call | match | directory-operations | using-the-threading-module | identity-operators-(is,-is-not) | complex-number | functional-programming | slicing | input | advanced-file-operations | id-function | mathematical-function | string-method | control-flow | dicts | global | command-line-parsing | global-keyword | key-value-pairs | type-conversion | __init_subclass__ | precedence-and-associativity | design-principle | time-series-with-pandas | max-min | thread-safe-data-structures-(queue.queue) | thread | set | using-else-and-finally | regular-expressions | print | method | sum-function | deep-copy | error | while-else-loop | filtering-and-indexing | function | sorting-and-ranking | conversion | conditional-statement | __all__-attribute | dataframe-and-series-objects | center | string | context-manager | variable | strings | dictionary-comprehensions | class-and-object | touples | python-operators | zip | software-design | logical-operators | multiprocessing | type-conversion | integer | test-discovery | mapping-function | random-function | constructor | asyncio | join | filter | version-check | intering | namespace | python_version | creating-and-starting-threads | default-mutable-argument | application | swapping | why-use-multiprocessing-over-threading?-(gil) | function-and-scope | python-module | indentation | tuple | print-statement | slice | recursion | python | version | frozenset | condition | operations | difference-between-threads-and-processes | syntax-error | while-loop | python-syntax-and-structure | data-structures-in-python | typeerror | file_handling | lambda-function | introduction-to-python | parsing-with-strptime | opening-files-(open()) | built-in-function | turtle | overflow | object-attribute | pickling--unpickling | oop | sorted | arithmetic-expression | filter-function | basic | reading:-read(),-readline(),-readlines() | encapsulation | generators-in-python | data-structures | compute | classes | goto-function | numeric | control-flow | choice | type_conversion | statement | class-and-instance-variable | else | feature | string-concatenation | binary-operation | identity-operator | list-join | random | string-method | using-os-and-pathlib-modules | operator-or | invalid-list | operators | unit-testing | exponentiation | string-slicing | overriding-methods | gil | creating-custom-modules | functional-programming | handling-missing-values-(fillna,-dropna) | pseudocode | head-and-tail | formatting-with-strftime | sorting | using-join()-and-is_alive()-methods | zfill-function | return-statement | operator-overloading | package-management | objects | syntax-error | postfix | generators | dictionary | odd-number | benefit | error-handling | function-argument | virtual-environment | heap-memory | boolean-masking | numpy | expand-tab | precedence | init | file-handling | class-and-inheritance | boolean | reading-and-writing-large-files-efficiently | iterable | set-operation | asyncio-module | list-indexing | introduction-to-multiprocessing | conditional-statements | iterator | using-lists-as-stacks | staticmethod | working-with-dates-and-times | raise | input-function | bitwise-operator | oops | int | python-django | operator | string-formatting | counter-function | datetime | default-arguments | inherit | string-slicing | comment | polymorphism | import-method | data-type | sum() | joining-and-merging-dataframes | pass | operand | yield | aggregating-data-with-functools.reduce() | identifier | class | integers | round-function | sys-module | rollback | introduction-to-threads | defining-functions | parameter | range | working-with-binary-files-(rb,-wb) | complex | copy | booleans | data-structure | shallow-copy | membership-operators-(in,-not-in) | destructor | factorial-function | syntaxerror ...