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