human
What is a Python program to find the sum of numbers in a list within a range specified by two indices given the following:
Write a function to find the sum of numbers in a list within a range specified by two indices. Here is a solution in Python:
assistant
#Here is Python program to find the sum of numbers in a list within a range specified by two indices.
 def sum_range_list(list1, m, n):                                                                                                                                                                                                
    sum_range = 0                                                                                                                                                                                                         
    for i in range(m, n+1, 1):                                                                                                                                                                                        
        sum_range += list1[i]                                                                                                                                                                                                  
    return sum_range