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