Friday, June 22, 2012

Last Question in Programming UT 1


def my7(a,b):

    total = a+b

    if (a > b):
        diff = a - b
    else:
        diff = b - a

    if (a == 7 or b == 7):
        return True
    elif (total == 7 or diff == 7):
        return True
    else:
        return False

No comments:

Post a Comment