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