πŸ“Š Python
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
πŸ’¬ Discuss
βœ… Correct Answer: (A) five neither thrive three

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
720
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Akash Lawaniya
Publisher
πŸ“ˆ
96%
Success Rate