''' Purpose: continue introduction to functions Name: Email id: Who checked your code: Whose code did you check: ''' def is_factor( x, y ) : ''' Parameters x and y are integers. The function returns whether y is a factor of x. ''' # compute remainder of x divided by y rem = x % y # check it out if ( rem == 0 ) : # check whether remainder is 0 result = True # if it is, return value is True else: result = False # if it is not, return value is False # return determination return result def are_relative_primes( x, y ) : ''' Parameters x and y are integers. The function returns whether x and y are relatively prime; i.e., whether y is not a factor of x and vice-versa. ''' ... def is_prime( x ) : ''' Parameter x is am integer. The function returns whether x is prime; i.e., its only factors are 1 and itself 1. ''' ... if __name__ == "__main__": import primal a1, b1 = 6, 2 a2, b2 = 7, 3 a3, b3 = 4, 5 f1 = primal.is_factor( a1, b1 ) f2 = primal.is_factor( a2, b2 ) f3 = primal.is_factor( a3, b3 ) print( 'is_factor(', a1, ',' , b1, ') = ', f1 ) print( 'is_factor(', a2, ',' , b2, ') = ', f2 ) print( 'is_factor(', a3, ',' , b3, ') = ', f3 )