Level 5 : What will this print?


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

Author: SandhyaR | Tags: list | 1736+ Python FAQs | Share
lambda | bitwise-operator | arithmetic-operation | raise | counter-function | filter-function | memory-management | sys | precedence-and-associativity | loop | overflow | goto-function | heap-memory | python-django | multithreading | immutability | installation | random-function | zfill-function | sum() | assert | built-in-function | method | benefit | global-variable | mapping-function | call | indexing | version | operand | bitwise-operator | operator-and | string-method | library | list-mutation | error | swapping | identity-operator | array | immutable-data-type | string | matrix | design-principle | data-type | math | sys-module | identity-operator | touples | list-vs-tuple | logical-operator | nested-loop | error-handling | update | expression | numeric | print | for | decorator | choice | counter | asyncio | sum-function | mathematical-function | docstring | context-manager | floating-point-precision | lists | interpreter | pickling-&-unpickling | escape-operator | join | application | file-handling | yield | frozenset | file | namespace | fabs-function | round | complex | default-mutable-argument | data_structure | built-in-function | decimal | comment | regex | dictionary | static-method | list-comprehension | print-statement | exponentiation | comprehension | python-module | functions | package-management | recursion | binary | conditional-statement | min-function | datetime | generators-in-python | global | software-design | assignment-operator | head-and-tail | max-min | lambda-function | indentation | generators | attribute | mathematics | file-handling | data-structure | async | parameter | round-function | copy | int | pandas | name-mangling | virtual-environment | slice | random | slicing | string-formatting | virtual-environment | methods | string-concatenation | filter | mutable | collections | math-copysign | scientific-notation | recurssion | dictionaries | string-iteration | syntax-error | operator-overloading | polymorphism | data-structures | string-slicing | class-and-instance-variable | zip | zip-function | boolean | function-argument | conditional-statement | identifier | python-history | formal-and-actual-parameter | data-type | complex-number | namedtuple | staticmethod | encapsulation | encoding | map-function | command-line-parsing | global-keyword | list-method | asyncio-module | class | object-attribute | type-conversion | list | bitwise | syntaxerror | higher-order-function | keyword | arithmetic-expression | functional-programming | factorial-function | min-max-function | memory | class-and-object | typeerror | python-repl | append | loop-control | sorting | string-manipulation | center | format | tuple-unpacking | python | data-structure | mysql | basic | list-join | classes | file_handling | regular-expression | __future__ | rollback | precedence | logical-operation | set | turtle | matrix-list-comprehension | loops | syntax-error | boolean-and-non-boolean | list-slicing | multiple-inheritance | operators | compute | string-slicing | variable | class-and-inheritance | odd-number | type_conversion | dicts | comparison | lambdas | gil | numpy | logical-operator | stack | condition | with-statement | destructor | pseudocode | oop | iterator | init | list-operation | __init_subclass__ | integer | pep | datatype | matplotlib | input | operations | sorted | thread | input-function | generator | expand-tab | inheritance | else-statement | global-variable | exception | __all__-attribute | string-method | list-indexing | python_version | constructor | feature | collection | invalid-list | split | access-modifier | enumerate() | string-formatting | debugging | control-statement | objects | iterable | while-else-loop | function | conversion | tuple | id-function | range | descriptors | control-flow | type-conversion | statement | magic-method | def | module | threading | deep-copy | return-statement | function-and-scope | shallow-copy | exception-handling | implementation | input-function | operator-or | match | syntax | list-comprehension | version-check | control-flow | exception-handling | multiprocessing | while-and-for-loop | postfix | built-in | binary-operation | inherit | oops | operator | while-loop | set-operation | import-method ...