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