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