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