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