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