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