Create a Python script which will accept two positive integers and will display the COMMON DIVISORS.
Sample Output:
Positive Integer 1 : 20
Positive Integer 2: 12
COMMON DIVISORS of 20 and 12 are...
1 2 4
I need the code to have an output stated above.
a = 20; b = 12
min = a if a < b else b
for i in range(1, min+1):
if a%i==0 and b %i==0:
print(i, end=' ')
Comments
Leave a comment