Level 3 : What will be the output of the following Python code?


class tester:
    def __init__(self, id):
        self.id = str(id)
        id="224"
 
temp = tester(12)
print(temp.id)

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