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