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