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