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