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