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