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