human
Count of numbers upto M divisible by given Prime Numbers | Function to count the numbers that are divisible by the numbers in the array from range 1 to M.
Initialize the count variable.
Iterate over [ 1 , M ].
Iterate over array elements arr [ ].
Check if i is divisible by a [ j ].
Increment the count.
Return the answer.
Given list lst.
Given number M.
Function call"
How can the above be solved in Python?
 ... Write me a code to count of numbers upto M divisible by given Prime Numbers and the other steps required?
assistant
#Here is code to count of numbers upto M divisible by given Prime Numbers and the other steps required.
 def count ( a , M , N ) :
	cnt = 0
	for i in range ( 1 , M + 1 ) :
		for j in range ( N ) :
			if ( i % a [ j ] == 0 ) :
				cnt += 1
				break
	return cnt
lst = [ 2 , 3 , 5 , 7 ]
m = 100
n = len ( lst )
print ( count ( lst , m , n ) )