MENU
Question -

The smallest common multiple of two or more numbers is called the lowest common multiple (LCM). Given a list of integers, find the lowest common multiple.



Answer -

def LCM(nums):
nums.sort()
biggest=nums[-l]
multiplier=1
while sum([(multiplier’|,biggest)%num for num in nums])!=0:
multiplier + = 1
return biggest*multiplier

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×