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