Level 9 : What will be the output of the following Python code?


l1=[10, 20, 30]
l2=[-10, -20, -30]
l3=[x+y for x, y in zip(l1, l2)]
print(l3)

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