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