Level 1 : What will this output?


lst = [[1, 2], [3, 4]]
result = [sum(x) for x in lst]
print(result)

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