human
Find sum of modulo K of first N natural number | Return sum of modulo K of first N natural numbers ..
Iterate from 1 to N && evaluating and adding i % K ..
Driver Code"
How can the above be solved in Python?
 Write me a code to find sum of modulo K of first N natural number and the other steps required?
assistant
#Here is code to find sum of modulo K of first N natural number and the other steps required.
 def findSum ( N , K ) :
	ans = 0 ;
	for i in range ( 1 , N + 1 ) :
		ans += ( i % K ) ;
	return ans ;
N = 10 ;
K = 2 ;
print ( findSum ( N , K ) ) ;