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


def solve(a):
   a = [1, 3, 5]
a = [2, 4, 6]
print(a)
solve(a)
print(a)

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