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