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