human
Sum of all subarrays of size K | Function to find the sum of all subarrays of size K.
Initialize sum = 0.
Consider first subarray of size k Store the sum of elements.
Print the current sum.
Consider every subarray of size k Remove first element and add current element to the window.
Add the element which enters into the window and subtract the element which pops out from the window of the size K.
Print the sum of subarray.
Drivers Code.
Function Call"
How can the above be solved in Python?

=====
What is a code to sum of all subarrays of size K and the other steps required?
assistant
#Here is code to sum of all subarrays of size K and the other steps required.
 def calcSum ( arr , n , k ) :
	sum = 0
	for i in range ( k ) :
		sum += arr [ i ]
	print ( sum , end = " ▁ " )
	for i in range ( k , n ) :
		sum = ( sum - arr [ i - k ] ) + arr [ i ]
		print ( sum , end = " ▁ " )
if __name__ == " _ _ main _ _ " :
	arr = [ 1 , 2 , 3 , 4 , 5 , 6 ]
	n = len ( arr )
	k = 3
	calcSum ( arr , n , k )