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