Python Armstrong NumberPython Average of N NumbersPython Biggest of Three NumbersPython Common DivisorsPython Composite NumberPython Condense a NumberPython Even NumberPython Factorial of a NumberPython Fibonacci SeriesPython GCDPython LCMPython Leap YearPython Multiplication TablePython Number CombinationPython Odd NumberPython Palindrome NumberPython Perfect NumberPython Prime FactorPython Prime NumberPython Sum of DigitsPython Swapping Two Numbers

Python Array ProgramsPython Converter ProgramsPython Star Patterns ProgramPython Number Patterns ProgramPython Alphabet Patterns ProgramLast Updated:

A number that divides two or more numbers without remainder.

**Tips**: It is recommended to use our online common divisor calculator for better understanding.

The following table provides few examples of common divisors of the given numbers.

Numbers | Common Divisors |
---|---|

4, 6 | 1, 2 |

12, 24 | 1, 2, 3, 4, 6, 12 |

15, 25, 50 | 1, 5 |

In the following example, we will find the common divisors of numbers 12 and 24.

Python Compiler

num1 = 12;
num2 = 24;
min = (num1 < num2) and num1 or num2;
print("Common Divisors of %d and %d: " % (num1 , num2))
for i in range(1, min+1):
if((num1 % i == 0) and (num2 % i == 0)):
print(i, end=" ")

In the following example, we will find the common divisors of any two given numbers.

Python Compiler

num1 = int(input("Enter (int) num1 = "));
num2 = int(input("Enter (int) num2 = "));
min = (num1 < num2) and num1 or num2;
print("\nCommon Divisors of %d and %d: " % (num1 , num2))
for i in range(1, min+1):
if((num1 % i == 0) and (num2 % i == 0)):
print(i, end=" ")