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