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