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


A = [[1, 2, 3],
     [4, 5, 6],
     [7, 8, 9]]
B = [[3, 3, 3],
     [4, 4, 4],
     [5, 5, 5]]
[B[row][col]*A[row][col] for row in range(3) for col in range(3)]

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