Question: ''' Edit the Python script named assignment1.py in the assignment1 directory. This script should compute the mean of a list of integers, but is incorrect.

'''

Edit the Python script named assignment1.py in the assignment1 directory. This script should compute the mean of a list of integers, but is incorrect. Fix the errors in the script so that the mean is computed correctly.

'''

L = [40, 35, 49, 53, 38, 39, 40, 37, 49, 34, 38, 43, 47]

n = len (L)

i = 1

total = 0

while i <= n:

total += L[i]

i += 1

avg = total // n

print ('the average is: ', avg')

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!