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