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