Level 5 : What will this print?


a = [1, 2, 3]
b = [[x, x**2] for x in a]
print(b)

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