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