In this article, we will implement very simple Python Program to Find HCF and LCM of a given number.
from functools import reduce
def gcd(a,b):
while b:
a,b=b,a%b
return a
def lcm(a,b):
return a*b//gcd(a,b)
a = [int(i) for i in input().split()]
print(reduce(gcd,a))
print(reduce(lcm,a))
########################################
from math import gcd as g
print(reduce(g,a))