Again that challenge

Free lines Python 1 revisions 585 2 years ago 2 years ago
# This is a code to prove that it is possible to find GCD of two numbers even
# without using any built in module

a = [int(input("Please enter the first number: "))]
b = [int(input("Please enter the second number: "))]

a = [x for x in range(1, a[0]+1) if a[0]%x == 0]
b = [x for x in range(1, b[0]+1) if b[0]%x == 0]
a = [x for x in b if x in a]

print("GCD of given numbers is:", max(a))

Some were not Okay with using built in module