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