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