human
Can you provide a code to ways to express a number as product of two different factors and the other steps required given the following:
Ways to express a number as product of two different factors | To count number of ways in which number expressed as product of two different numbers.
To store count of such pairs.
Counting number of pairs upto sqrt ( n ) - 1.
To return count of pairs.
Driver program to test countWays ( )"
How can the above be solved in Python?
assistant
#Here is code to ways to express a number as product of two different factors and the other steps required.
 def countWays ( n ) :
	count = 0
	i = 1
	while ( ( i * i ) < n ) :
		if ( n % i == 0 ) :
			count += 1
		i += 1
	return count
n = 12
print ( countWays ( n ) )