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 | 1736+ Python FAQs | Share
zfill-function | global-variable | while-else-loop | built-in | object-attribute | filter-function | string-manipulation | debugging | control-flow | dictionaries | encoding | numeric | logical-operator | operations | filter | sum-function | list-operation | design-principle | binary-operation | scientific-notation | loops | factorial-function | string-method | python-django | string-iteration | for | lambda-function | floating-point-precision | operators | context-manager | list-vs-tuple | iterable | typeerror | bitwise-operator | type-conversion | random-function | python-history | indentation | loop-control | sorted | collections | conditional-statement | string-method | pandas | generator | condition | class-and-inheritance | error | functional-programming | binary | multiple-inheritance | lambda | file_handling | with-statement | list | zip | bitwise | version-check | print | asyncio-module | built-in-function | magic-method | arithmetic-expression | fabs-function | list-slicing | feature | descriptors | deep-copy | def | logical-operation | raise | pseudocode | package-management | arithmetic-operation | invalid-list | else-statement | max-min | control-statement | library | enumerate() | class | __init_subclass__ | application | generators-in-python | string-formatting | recurssion | exception | async | odd-number | input-function | global-variable | decorator | __all__-attribute | virtual-environment | integer | namespace | mutable | destructor | precedence-and-associativity | module | round-function | matplotlib | installation | file | global | match | map-function | encapsulation | implementation | data_structure | data-structures | mathematical-function | built-in-function | range | expand-tab | exception-handling | tuple | syntaxerror | append | round | string-concatenation | statement | import-method | staticmethod | function-and-scope | file-handling | list-method | rollback | join | mysql | control-flow | input | decimal | static-method | int | operator-or | complex-number | input-function | polymorphism | multithreading | name-mangling | data-type | min-max-function | data-structure | conversion | logical-operator | operator-and | constructor | goto-function | exponentiation | objects | higher-order-function | datetime | asyncio | list-comprehension | classes | swapping | lists | threading | identity-operator | while-loop | dicts | dictionary | turtle | min-function | slice | file-handling | python_version | matrix | frozenset | function | comprehension | while-and-for-loop | default-mutable-argument | generators | python-repl | math-copysign | oops | docstring | function-argument | copy | multiprocessing | datatype | touples | version | exception-handling | command-line-parsing | sorting | data-type | __future__ | random | methods | shallow-copy | counter | zip-function | counter-function | immutable-data-type | method | oop | type_conversion | comparison | variable | namedtuple | type-conversion | string-formatting | access-modifier | python-module | compute | string | thread | center | iterator | inheritance | numpy | escape-operator | sys-module | slicing | boolean | choice | overflow | call | nested-loop | global-keyword | interpreter | class-and-object | math | syntax | collection | stack | list-mutation | identity-operator | lambdas | basic | yield | operator-overloading | loop | python | string-slicing | pickling-&-unpickling | attribute | list-indexing | assignment-operator | pep | heap-memory | memory | sys | regex | keyword | string-slicing | precedence | benefit | regular-expression | print-statement | format | virtual-environment | memory-management | array | set | software-design | list-comprehension | syntax-error | identifier | matrix-list-comprehension | comment | complex | operand | return-statement | mathematics | boolean-and-non-boolean | assert | set-operation | postfix | gil | immutability | list-join | recursion | error-handling | id-function | sum() | inherit | class-and-instance-variable | init | update | indexing | split | formal-and-actual-parameter | bitwise-operator | syntax-error | conditional-statement | functions | data-structure | tuple-unpacking | parameter | operator | mapping-function | expression | head-and-tail ...