Given two integer numbers, the task is to find count of all common divisors of given numbers?

Input : a = 12, b = 24 Output: 6 // all common divisors are 1, 2, 3, // 4, 6 and 12 Input : a = 3, b = 17 Output: 1 // all common divisors are 1 Input : a = 20, b = 36 Output: 3 // all common divisors are 1, 2, 4

`# Python Program to find ` `# Common Divisors of Two Numbers ` ` ` `a ` `=` `12` `b ` `=` `24` `n ` `=` `0` ` ` `for` `i ` `in` `range` `(` `1` `, ` `min` `(a, b)` `+` `1` `): ` ` ` `if` `a` `%` `i` `=` `=` `b` `%` `i` `=` `=` `0` `: ` ` ` `n` `+` `=` `1` ` ` `print` `(n) ` ` ` `# Code contributed by Mohit Gupta_OMG ` |

*chevron_right*

*filter_none*

**Output:**

6

Please refer complete article on Common Divisors of Two Numbers for more details!

## Recommended Posts:

- Python program to check if the list contains three consecutive common numbers in Python
- Python Program that Displays Letters that are not common in two strings
- Python Program for Check if count of divisors is even or odd
- Python | Check if two lists have any element in common
- Python | Combine two dictionary adding values for common keys
- Python Program for Longest Common Subsequence
- Python program to find common elements in three lists using sets
- Python program to find the frequency of the elements which are common in a list of strings
- Python Program for GCD of more than two (or array) numbers
- Python program to add two numbers
- Python Program to find the Quotient and Remainder of two numbers
- Python program to find the gcd of two numbers
- Python program to add two Octal numbers
- Python Program to add two hexadecimal numbers
- Python program to add two binary numbers
- Python - Test if common values are greater than K
- Python | Find most common element in each column in a 2D list
- Python | Find common elements in list of lists
- Python | Print the common elements in all sublists
- Python | Find most common element in a 2D list