I got a problem, when I need to check ff the number is divisible by 3, it should return “Divi”. If it is divisible by 3, it should return “Sible”. If it is divisible by both 2 and 3, it should return “DiviSible”.
I tried this code, however if my x = 6, I want to only show "Divisible" and not "divi" and "sible". However, this code returns the three values to me. Any idea on how to make it work? THANKS!
def fun_divi():
if(x%2==0):
print("Divi")
if(x%3==0):
print("Sible")
if(x%2==0) and (x%3==0):
print("Divisible")
else:
print("Not divisible by any")
fizz_buzz()