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


l1=[1,2,3]
l2=[4,5,6]
[x*y for x in l1 for y in l2]

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