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