Level 9 : What will be the output of the following Python code?


def change(var, lst):
    var = 1
    lst[0] = 44
k = 3
a = [1, 2, 3]
change(k, a)
print(k)
print(a)

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