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