Level 1 : What will be the output of the following Python code?


A = [[1, 2, 3],
     [4, 5, 6],
     [7, 8, 9]]
 
[[col + 10 for col in row] for row in A]

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