Level 1 : What does the following expression return?


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

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