קורס פייתון תרגיל 6

"""The program choose randomally
2 numbers between 1 - 10 and print the 
minimum divided number by both of them"""

result = 0
from random import randint
num1 = randint(1,10)
num2 = randint(1,10)
print "num1 is {} and num2 is {}".format(num1,num2)
if num1 == num2:
    result = 2 * num1
    print result
elif num1 > num2:
    if num2 == 1:
        result = 2 * num1
        print result
    else:

        for i in range(2,num2+1):
            if (i * num1) % num2 == 0:
                result = i * num1
                print result
                break
else:
    if num1 == 1:
        result = 2 * num2
        print result
    else:
        for i in range(2,num1 +1):
            if (i * num2) % num1 == 0:
                result = i * num2
                print result
                break