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