Level 3 : What is the output of this dictionary slicing operation?


d = {'a': 10, 'b': 20, 'c': 30}
print(d['a':'c'])

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