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