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