human
Program to find count of numbers having odd number of divisors in given range | Function to count numbers having odd number of divisors in range [ A , B ].
variable to odd divisor count.
iterate from a to b and count their number of divisors.
variable to divisor count.
if count of divisor is odd then increase res by 1.
Driver code"
How can the above be solved in Python?
 ... Can you provide a code to program to find count of numbers having odd number of divisors in given range and the other steps required?
assistant
#Here is code to program to find count of numbers having odd number of divisors in given range and the other steps required.
 def OddDivCount ( a , b ) :
	res = 0
	for i in range ( a , b + 1 ) :
		divCount = 0
		for j in range ( 1 , i + 1 ) :
			if ( i % j == 0 ) :
				divCount += 1
		if ( divCount % 2 ) :
			res += 1
	return res
if __name__ == " _ _ main _ _ " :
	a = 1
	b = 10
	print ( OddDivCount ( a , b ) )