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