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