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