Level 9 : What will be the output of the following code snippet?


def thrive(n):
 if n % 15 == 0:
   print("thrive", end = “ ”)
 elif n % 3 != 0 and n % 5 != 0:
   print("neither", end = “ ”)
 elif n % 3 == 0:
   print("three", end = “ ”)
 elif n % 5 == 0:
   print("five", end = “ ”)
thrive(35)
thrive(56)
thrive(15)
thrive(39)

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