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