Level 1 : What will be the output of the following code?


d = {True: 'Yes', 1: 'No', 1.0: 'Maybe'}
print(d)

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