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