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