1def hcf(x, y):
2 if x > y:
3 smaller = y
4 else:
5 smaller = x
6 for i in range(1,smaller + 1):
7 if((x % i == 0) and (y % i == 0)):
8 hcf = i
9 return hcf
10
11num1 = int(input("Enter first number: "))
12num2 = int(input("Enter second number: "))
13print("The H.C.F. of", num1,"and", num2,"is", hcf(num1, num2))