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