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