human
Find subarray with given sum | Set 1 ( Nonnegative Numbers ) | Returns true if the there is a subarray of arr [ ] with sum equal to ' sum ' otherwise returns false . Also , prints the result.
Pick a starting point.
try all subarrays starting with 'i  .
Driver program"
How can the above be solved in Python?

=====
Give me a code to find subarray with given sum and the other steps required?
assistant
#Here is code to find subarray with given sum and the other steps required.
 def subArraySum ( arr , n , sum_ ) :
	for i in range ( n ) :
		curr_sum = arr [ i ]
		j = i + 1
		while j <= n :
			if curr_sum == sum_ :
				print ( " Sum ▁ found ▁ between " )
				print ( " indexes ▁ % ▁ d ▁ and ▁ % ▁ d " % ( i , j - 1 ) )
				return 1
			if curr_sum > sum_ or j == n :
				break
			curr_sum = curr_sum + arr [ j ]
			j += 1
	print ( " No ▁ subarray ▁ found " )
	return 0
arr = [ 15 , 2 , 4 , 8 , 9 , 5 , 10 , 23 ]
n = len ( arr )
sum_ = 23
subArraySum ( arr , n , sum_ )