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