Level 9 : What is the output of the following code?


def courses(letter):
    switch = { 'a': 'Python', 'b':'java', 'c':'React'}
    return switch.get(letter, "Golang")

courses('aa')

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