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 | 1736+ Python FAQs | Share
print-statement | math-copysign | def | enumerate() | design-principle | class | input-function | list-vs-tuple | global | raise | exponentiation | typeerror | function | syntaxerror | staticmethod | virtual-environment | identity-operator | global-keyword | comprehension | sum-function | error | loop | numeric | lists | sys | operator-or | id-function | formal-and-actual-parameter | functional-programming | type_conversion | sorted | class-and-instance-variable | asyncio | application | zfill-function | mutable | oops | filter-function | operations | collection | syntax-error | min-max-function | installation | boolean-and-non-boolean | python | mysql | docstring | control-statement | matplotlib | bitwise-operator | package-management | string-method | with-statement | integer | sorting | list-operation | attribute | python-django | generator | global-variable | datatype | loops | zip | set-operation | binary-operation | min-function | head-and-tail | frozenset | swapping | logical-operator | rollback | basic | version-check | library | fabs-function | name-mangling | string-slicing | append | dictionary | for | default-mutable-argument | precedence-and-associativity | heap-memory | debugging | interpreter | map-function | counter-function | assignment-operator | matrix-list-comprehension | multiple-inheritance | classes | datetime | encoding | module | class-and-object | loop-control | invalid-list | regex | sys-module | magic-method | string-manipulation | list-comprehension | factorial-function | immutable-data-type | filter | objects | operators | choice | overflow | generators-in-python | else-statement | input | built-in | string-method | context-manager | escape-operator | python-history | string-slicing | sum() | virtual-environment | nested-loop | floating-point-precision | postfix | inheritance | counter | list-mutation | constructor | comment | assert | list | dicts | built-in-function | asyncio-module | binary | join | __future__ | expand-tab | feature | comparison | list-join | scientific-notation | software-design | __all__-attribute | parameter | init | list-indexing | while-loop | threading | python_version | access-modifier | identity-operator | return-statement | int | generators | type-conversion | iterable | python-repl | data-type | class-and-inheritance | memory | update | file_handling | string-concatenation | file | split | mapping-function | copy | benefit | variable | identifier | logical-operator | lambdas | functions | goto-function | recurssion | conditional-statement | numpy | slicing | global-variable | range | string | descriptors | random | data-structure | multithreading | namedtuple | decimal | dictionaries | pickling-&-unpickling | syntax | odd-number | destructor | gil | data-structures | indexing | format | exception-handling | input-function | yield | bitwise | complex | lambda | pandas | compute | data_structure | math | shallow-copy | control-flow | call | recursion | while-else-loop | complex-number | type-conversion | method | collections | syntax-error | methods | file-handling | error-handling | function-and-scope | logical-operation | implementation | matrix | tuple-unpacking | set | tuple | data-type | random-function | bitwise-operator | keyword | deep-copy | mathematics | immutability | exception-handling | string-formatting | __init_subclass__ | condition | while-and-for-loop | center | list-slicing | zip-function | print | python-module | mathematical-function | slice | thread | round | arithmetic-expression | multiprocessing | statement | import-method | boolean | conditional-statement | expression | pep | lambda-function | decorator | string-iteration | conversion | string-formatting | built-in-function | list-method | touples | encapsulation | polymorphism | async | max-min | data-structure | stack | round-function | operator-and | static-method | function-argument | object-attribute | command-line-parsing | memory-management | arithmetic-operation | iterator | list-comprehension | array | higher-order-function | operator-overloading | oop | match | inherit | operand | namespace | version | indentation | pseudocode | regular-expression | control-flow | turtle | file-handling | exception | precedence | operator ...