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