Level 1 : What will be the output of the following code snippet?


a = [1, 2, 3]
a = tuple(a)
a[0] = 2
print(a)

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