Level 5 : What is the output for the below code?


def modify_list(lst):
    lst = lst + [4]
    return lst

x = [1, 2, 3]
modify_list(x)
print(x)

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