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