Sum of Squares from M to N
Write a function with name sum_of_squaresm_to_n that takes two integers (M and N) and sum the squares from M to N.
The first line of input will contain an integer (M).
The second line of input will contain an integer (N).
The output should be a single line containing the sum of the squares from M to N.
For example, if the given M is 3 and N is 5, the sum of squares of 3, 4 and 5 is 50. So the output should be 50.
Sample Input 1
Sample Output 1
Sample Input 2
Sample Output 2
def sum_of_squares_m_to_n(m, n): sum=0 for i in range(m,n+1): sum+=i**2 return sum m = int(input()) n = int(input()) result=sum_of_squares_m_to_n(m,n) print(result)