Level 1 : After calling the fun function, what is the new content of the list p?


def fun(values):
    values[0] = 1
p = [2,3,4]
fun(p)
print(p)

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