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