def is_divisor(a, b): if b % a == 0: return f"{a} is a divisor of {b}" else: return f"{a} is not a divisor of {b}" a = int(input("Enter number A: ")) b = int(input("Enter number B: ")) print(is_divisor(a, b))
Пример использования:
Enter number A: 3 Enter number B: 15 3 is a divisor of 15
if b % a == 0:
return f"{a} is a divisor of {b}"
else:
return f"{a} is not a divisor of {b}"
a = int(input("Enter number A: "))
b = int(input("Enter number B: "))
print(is_divisor(a, b))
Пример использования:
Enter number A: 3Enter number B: 15
3 is a divisor of 15