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