1# Python code to demonstrate calling the
2#This example will help you to learn about funtion and function call
3#added by: vikalp chaubey
4# function from another function
5
6def Square(X):
7 # computes the Square of the given number
8 # and return to the caller function
9 return (X * X)
10
11def SumofSquares(Array, n):
12
13 # Initialize variable Sum to 0. It stores the
14 # Total sum of squares of the array of elements
15 Sum = 0
16 for i in range(n):
17
18 # Square of Array[i] element is stored in SquaredValue
19 SquaredValue = Square(Array[i])
20
21 # Cummulative sum is stored in Sum variable
22 Sum += SquaredValue
23 return Sum
24
25# Driver Function
26Array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
27n = len(Array)
28
29# Return value from the function
30# Sum of Squares is stored in Total
31Total = SumofSquares(Array, n)
32print("Sum of the Square of List of Numbers:", Total)
33