Level 10 : Choose the correct option for the below.


a=[1,2,3,4]
b=[sum(a[0:x+1]) for x in range(0,len(a))]
print(b)

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