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