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