Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write a function to print all the common multiples of 6 and 10, less than 100. I

ID: 3653748 • Letter: W

Question

write a function to print all the common multiples of 6 and 10, less than 100. In general, the function should take three input parameters: two numbers (X & Y) whose common multiples have to be found, and the upper limit Z. #I wrote a program that finds all the common multiples x= int(raw_input("Enter your first number: ")) y= int(raw_input("Enter your second number: ")) z= int(raw_input("Enter a top range number: ")) for num in range (1,z): if num%x==0: answer=num print answer for other in range (1,z): if other%y==0: answer1=other print answer1 #but i can not compare them... i tried doing something like: if answer==answer1: print answer #but its not working. please help!

Explanation / Answer

################################################################ # program name: least common multiple and gratest common facter # author: max baseman # email: dos.fool@gmail.com # date: 01/16/07 # description: a program to find the LCM # and gcf of three given numbers # # ################################################################ print print print"enter three numbers to get the LCM and gcf of" num1=input("number 1 >") num2=input("number 2 >") num3=input("number 3 >") #find the lowest number if num1 num2: high=num3 # start at the largest number because the LCM cant be smaller then the highist number number=high #loop till finds the lowest number while 1: numtest=number+.0 if numtest/num1 == number/num1: if numtest/num2 == number/num2: if numtest/num3 == number/num3: break number=number+1 LCM=number #apply number to LCM so that i can keep useing number for GCF number=2 while number