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