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