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