Level 1 : What does the following expression return?


d = {'a': 1, 'b': 2}
print(d.fromkeys(['x', 'y'], 10))

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