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