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