Level 7 : 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 | 1736+ Python FAQs | Share
operator-or | debugging | pseudocode | else-statement | random | list-slicing | pep | multiprocessing | binary | loop | error | arithmetic-operation | lambda | type_conversion | multithreading | list-comprehension | built-in | string-method | syntax-error | lists | file_handling | match | stack | input-function | identity-operator | list-comprehension | sum() | copy | id-function | condition | package-management | input | datetime | conditional-statement | heap-memory | version-check | __all__-attribute | enumerate() | python-history | string-formatting | version | tuple-unpacking | matplotlib | exponentiation | overflow | round-function | class-and-inheritance | escape-operator | loop-control | method | fabs-function | collection | operators | decimal | python-django | list-vs-tuple | file-handling | generators-in-python | global | constructor | polymorphism | string-method | counter-function | string-concatenation | append | feature | function | data-structure | keyword | typeerror | binary-operation | dictionary | mathematics | memory | join | scientific-notation | syntax | logical-operator | invalid-list | logical-operation | encoding | decorator | python-module | interpreter | format | data-structures | variable | sys-module | postfix | threading | __future__ | init | with-statement | python_version | objects | zip-function | recursion | global-variable | gil | nested-loop | set | string-formatting | asyncio-module | inherit | indentation | error-handling | control-flow | matrix | set-operation | python-repl | basic | choice | sys | bitwise-operator | classes | indexing | file | counter | return-statement | design-principle | comparison | name-mangling | async | static-method | numeric | filter | yield | factorial-function | iterable | shallow-copy | descriptors | global-keyword | precedence | max-min | update | head-and-tail | default-mutable-argument | regex | generators | multiple-inheritance | operator | list-mutation | attribute | exception | while-loop | lambda-function | built-in-function | bitwise-operator | int | installation | data-structure | syntax-error | center | methods | turtle | thread | tuple | docstring | math-copysign | operand | complex-number | oop | odd-number | mathematical-function | memory-management | slicing | goto-function | class-and-instance-variable | application | string-slicing | for | module | virtual-environment | function-argument | compute | zfill-function | pandas | swapping | boolean | datatype | immutability | floating-point-precision | control-statement | assert | list-operation | input-function | class | operator-and | raise | identifier | __init_subclass__ | matrix-list-comprehension | encapsulation | array | virtual-environment | range | while-else-loop | library | class-and-object | expression | operations | dicts | mysql | filter-function | min-function | pickling-&-unpickling | conditional-statement | import-method | asyncio | destructor | iterator | regular-expression | formal-and-actual-parameter | string | immutable-data-type | logical-operator | function-and-scope | print-statement | command-line-parsing | precedence-and-associativity | complex | syntaxerror | min-max-function | bitwise | global-variable | software-design | def | data_structure | exception-handling | file-handling | staticmethod | generator | split | collections | python | string-manipulation | frozenset | comprehension | integer | rollback | touples | object-attribute | operator-overloading | round | loops | functions | mutable | higher-order-function | comment | slice | identity-operator | print | data-type | math | magic-method | sorting | call | dictionaries | map-function | oops | expand-tab | random-function | statement | list-indexing | parameter | control-flow | string-iteration | boolean-and-non-boolean | list-method | numpy | implementation | built-in-function | list-join | namespace | namedtuple | lambdas | exception-handling | arithmetic-expression | type-conversion | zip | access-modifier | sorted | functional-programming | list | data-type | assignment-operator | type-conversion | conversion | string-slicing | recurssion | context-manager | benefit | while-and-for-loop | mapping-function | inheritance | sum-function | deep-copy ...