Level 10 : 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 | 1736+ Python FAQs | Share
access-modifier | thread | oop | operator-or | choice | mathematics | data-type | matrix-list-comprehension | sorting | __future__ | control-flow | range | gil | yield | data-type | postfix | print-statement | complex-number | identity-operator | math-copysign | name-mangling | mutable | input-function | destructor | recursion | slicing | pep | exception-handling | global | logical-operation | function-and-scope | list-slicing | objects | raise | class-and-object | polymorphism | list-method | comparison | data-structure | join | filter-function | string-slicing | rollback | asyncio-module | binary | round | __init_subclass__ | sys | expression | dictionaries | print | statement | datetime | command-line-parsing | exception-handling | data-structures | global-variable | context-manager | decorator | sum-function | iterator | list-join | scientific-notation | map-function | encoding | binary-operation | virtual-environment | type-conversion | encapsulation | string-formatting | version-check | else-statement | basic | parameter | import-method | condition | string-manipulation | software-design | python_version | boolean | lambdas | function | arithmetic-operation | enumerate() | magic-method | pickling-&-unpickling | conversion | virtual-environment | feature | python-module | class-and-instance-variable | fabs-function | method | complex | library | string-method | sorted | math | boolean-and-non-boolean | higher-order-function | regex | nested-loop | min-max-function | for | type-conversion | list-mutation | slice | operator-overloading | loop | immutability | input-function | def | dictionary | functions | syntaxerror | zip-function | python-history | with-statement | list-operation | staticmethod | list-comprehension | immutable-data-type | python-repl | version | precedence | lambda-function | precedence-and-associativity | interpreter | string-iteration | max-min | swapping | file-handling | logical-operator | pandas | random | oops | global-keyword | tuple | inherit | center | error-handling | benefit | operations | typeerror | control-flow | match | array | operators | turtle | min-function | collections | indexing | keyword | sys-module | docstring | design-principle | recurssion | python-django | installation | while-else-loop | identity-operator | list-vs-tuple | generators | loop-control | conditional-statement | append | mapping-function | formal-and-actual-parameter | counter | set | syntax-error | async | package-management | zip | file_handling | identifier | set-operation | multiprocessing | variable | bitwise-operator | touples | module | format | random-function | application | input | numeric | integer | frozenset | compute | lists | default-mutable-argument | filter | split | comment | data_structure | update | descriptors | list | int | memory-management | built-in-function | classes | iterable | object-attribute | debugging | static-method | arithmetic-expression | shallow-copy | expand-tab | operator-and | global-variable | type_conversion | error | counter-function | call | asyncio | round-function | function-argument | generators-in-python | floating-point-precision | bitwise-operator | comprehension | indentation | class-and-inheritance | matrix | methods | string | mathematical-function | numpy | deep-copy | overflow | goto-function | collection | assert | built-in-function | mysql | id-function | factorial-function | heap-memory | string-method | dicts | assignment-operator | memory | built-in | __all__-attribute | operand | copy | functional-programming | attribute | class | data-structure | operator | generator | string-slicing | sum() | logical-operator | string-formatting | threading | implementation | list-comprehension | exponentiation | loops | file | file-handling | multithreading | decimal | syntax | matplotlib | while-loop | syntax-error | datatype | odd-number | head-and-tail | namedtuple | zfill-function | exception | while-and-for-loop | lambda | regular-expression | string-concatenation | tuple-unpacking | conditional-statement | constructor | stack | inheritance | pseudocode | bitwise | control-statement | list-indexing | invalid-list | init | namespace | python | multiple-inheritance | escape-operator | return-statement ...