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