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