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