Level 10 : What will this code output?


lst = [1, 2, 3, 4]
for i in range(len(lst)):
    lst[i] += i
print(lst)

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