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