Level 1 : What is the output for the following code?


def getEmployee(index):
	employee = {"P" : "Pavan" "p" : "Peter", "A" : "Alex", "C" : "Camren"}
	return employee[index]

print(getEmployee("P"))

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