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