A

Admin • 833.24K Points
Coach

Q. What will be the output of the following code snippet?

Code:
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)
  • (A) five neither thrive three
  • (B) five neither three thrive
  • (C) three three three three
  • (D) five neither five neither
  • Correct Answer - Option(A)
  • Views: 33
  • Filed under category Python
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.