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