Level 1 : What does this dictionary comprehension return?


d = {x: x**2 for x in range(3)}
print(d)

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