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