The following code shows an example to Find the Sum and Average of List Elements in Python. In order to perform it first create a list. After that take a variable sum. Initialize it to 0. Now start a for-loop. For the purpose of finding the count of elements in the list, we can use the range() function. Further, add all elements of the list in the loop. Once you get the sum, display it using the print() function. Finally, compute the average and display it. Also, you can round the average to two places of decimal.
mylist=[12, 11, 45, 90, 88, 70]
print('list elements: ')
for i in range(len(mylist)):
print('Sum of List Elements: '+str(sum))