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 | 1736+ Python FAQs | Share
zip | pep | input-function | call | list-method | identifier | split | update | syntax | format | parameter | binary | touples | virtual-environment | multithreading | string-method | decimal | syntax-error | built-in-function | iterable | tuple-unpacking | default-mutable-argument | counter-function | operations | id-function | filter-function | built-in-function | heap-memory | type_conversion | global | docstring | function-argument | version-check | python-repl | list-comprehension | while-and-for-loop | max-min | python-history | exception-handling | round-function | python_version | lambda | debugging | integer | return-statement | asyncio-module | bitwise | list | virtual-environment | control-flow | min-function | overflow | operator-or | random | dictionaries | oops | filter | input-function | list-operation | for | dicts | boolean-and-non-boolean | collection | type-conversion | function-and-scope | counter | slicing | join | pickling-&-unpickling | file | sys-module | descriptors | logical-operator | postfix | async | methods | python-module | deep-copy | memory-management | command-line-parsing | data-structure | rollback | math | interpreter | class-and-instance-variable | list-join | functions | generators | class-and-object | lists | conversion | regex | memory | access-modifier | statement | decorator | exponentiation | benefit | list-slicing | staticmethod | indentation | comment | global-keyword | syntaxerror | math-copysign | string-iteration | immutable-data-type | conditional-statement | thread | gil | numeric | expression | random-function | control-flow | encoding | range | center | floating-point-precision | namedtuple | __init_subclass__ | mathematics | string-formatting | basic | __all__-attribute | condition | global-variable | choice | objects | scientific-notation | collections | error | else-statement | sorting | method | arithmetic-expression | string-formatting | dictionary | keyword | tuple | file_handling | factorial-function | list-comprehension | nested-loop | round | bitwise-operator | higher-order-function | zfill-function | assert | encapsulation | lambda-function | __future__ | list-mutation | import-method | classes | operand | identity-operator | precedence | list-indexing | exception | iterator | swapping | built-in | matplotlib | immutability | python | loop | arithmetic-operation | string-slicing | sum() | lambdas | pseudocode | string-method | generators-in-python | version | precedence-and-associativity | operator-and | goto-function | yield | turtle | data-structure | context-manager | fabs-function | constructor | indexing | python-django | print-statement | compute | numpy | sys | list-vs-tuple | recursion | installation | complex-number | operator | binary-operation | array | datatype | feature | package-management | matrix | polymorphism | datetime | file-handling | comparison | mathematical-function | pandas | class | string | stack | formal-and-actual-parameter | while-else-loop | shallow-copy | static-method | control-statement | global-variable | while-loop | threading | software-design | logical-operation | match | attribute | boolean | mysql | file-handling | min-max-function | regular-expression | error-handling | zip-function | inheritance | head-and-tail | matrix-list-comprehension | library | input | data-structures | sorted | assignment-operator | mapping-function | operator-overloading | asyncio | mutable | loop-control | oop | complex | application | multiple-inheritance | recurssion | identity-operator | string-manipulation | set | bitwise-operator | set-operation | namespace | operators | append | data-type | sum-function | raise | print | loops | exception-handling | copy | string-slicing | inherit | multiprocessing | invalid-list | data-type | destructor | conditional-statement | class-and-inheritance | enumerate() | design-principle | with-statement | magic-method | functional-programming | name-mangling | syntax-error | object-attribute | type-conversion | string-concatenation | escape-operator | def | module | typeerror | function | generator | slice | frozenset | map-function | implementation | logical-operator | data_structure | init | variable | odd-number | int | expand-tab | comprehension ...