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