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