Level 10 : 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 | 1736+ Python FAQs | Share
python-django | dictionary | filter-function | debugging | global-keyword | error | counter-function | list-comprehension | sys | precedence | data-structures | multiprocessing | return-statement | string-formatting | overflow | loop | turtle | identity-operator | assert | identifier | generators | nested-loop | encapsulation | math | with-statement | bitwise-operator | int | collections | bitwise | threading | constructor | print | dictionaries | lambda-function | staticmethod | object-attribute | decorator | operator-and | type_conversion | name-mangling | math-copysign | precedence-and-associativity | init | round-function | while-else-loop | encoding | syntaxerror | odd-number | pickling-&-unpickling | polymorphism | virtual-environment | id-function | sum() | append | condition | string-iteration | design-principle | zip | file | list-comprehension | mathematical-function | class-and-inheritance | __init_subclass__ | exponentiation | feature | statement | function | invalid-list | regular-expression | enumerate() | operator-overloading | function-and-scope | arithmetic-operation | mutable | floating-point-precision | sum-function | bitwise-operator | keyword | data-structure | command-line-parsing | def | else-statement | binary | pep | default-mutable-argument | immutable-data-type | random-function | conditional-statement | control-statement | tuple | control-flow | round | magic-method | class-and-instance-variable | class-and-object | input-function | loop-control | installation | objects | built-in-function | format | set | datetime | asyncio-module | methods | attribute | join | collection | generators-in-python | matplotlib | control-flow | lambda | inheritance | complex-number | lists | zfill-function | operator | heap-memory | tuple-unpacking | conversion | exception-handling | data-type | list | exception | filter | sorted | comment | comparison | functions | pseudocode | memory-management | yield | file_handling | function-argument | random | postfix | scientific-notation | global | module | mathematics | iterator | sorting | raise | choice | recursion | classes | context-manager | while-loop | datatype | numeric | string-concatenation | touples | docstring | application | string-slicing | multithreading | functional-programming | string-method | integer | dicts | array | min-function | variable | built-in-function | complex | class | data-structure | deep-copy | map-function | list-method | logical-operator | syntax-error | typeerror | expand-tab | destructor | lambdas | python-repl | basic | benefit | import-method | operator-or | descriptors | set-operation | slicing | list-slicing | counter | slice | syntax-error | data-type | library | input | package-management | arithmetic-expression | input-function | operators | factorial-function | list-join | string-formatting | max-min | while-and-for-loop | string-manipulation | method | multiple-inheritance | print-statement | center | operand | immutability | conditional-statement | decimal | formal-and-actual-parameter | gil | comprehension | namedtuple | async | zip-function | fabs-function | numpy | memory | escape-operator | match | built-in | loops | python-history | python_version | pandas | logical-operation | min-max-function | copy | call | string-slicing | list-indexing | rollback | parameter | exception-handling | higher-order-function | mysql | binary-operation | asyncio | expression | list-operation | global-variable | sys-module | frozenset | iterable | operations | goto-function | swapping | logical-operator | file-handling | indexing | matrix | implementation | python | string-method | recurssion | virtual-environment | python-module | version-check | oop | string | shallow-copy | compute | split | stack | access-modifier | head-and-tail | file-handling | matrix-list-comprehension | type-conversion | global-variable | inherit | __future__ | indentation | oops | __all__-attribute | thread | list-vs-tuple | data_structure | software-design | interpreter | type-conversion | boolean | static-method | regex | for | syntax | boolean-and-non-boolean | namespace | range | update | assignment-operator | identity-operator | error-handling | mapping-function | version | generator | list-mutation ...