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