Level 9 : Which of the following is the correct output of this program?


class book:  
    def __init__(a, b):  
        a.o1 = b  
   
class child(book):  
    def __init__(a, b):  
        a.o2 = b  
   
obj = page(32)  
print "%d %d" % (obj.o1, obj.o2)

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