Can you fix it? _ Terminal0.1571 # Declare a named constant for array size here.0.2422 MAX_AVERAGES = 80.203A-Z0.1984 # Declare array here.0.3335 averages[] 0.270.197 # Write a loop to...


Can you fix it?


List Basics in Python<br>Tasks<br>BattingAverage.py<br>>_ Terminal<br>0.157<br>1 # Declare a named constant for array size here.<br>0.242<br>2 MAX_AVERAGES = 8<br>0.203<br>A-Z<br>0.198<br>4 # Declare array here.<br>0.333<br>5 averages<br>[]<br></><br>0.27<br>0.19<br>7 # Write a loop to get batting averages from user and assign to<br>array.<br>Maximum batting average is 0.333<br>Minimum batting average is 0.157<br>8 for i in range (MAX_AVERAGES):<br>averageString = input(

Extracted text: List Basics in Python Tasks BattingAverage.py >_ Terminal 0.157 1 # Declare a named constant for array size here. 0.242 2 MAX_AVERAGES = 8 0.203 A-Z 0.198 4 # Declare array here. 0.333 5 averages [] 0.27 0.19 7 # Write a loop to get batting averages from user and assign to array. Maximum batting average is 0.333 Minimum batting average is 0.157 8 for i in range (MAX_AVERAGES): averageString = input("Enter a batting average: ") battingAverage = float(averageString) # Assign value to array. 9. Average batting average is 0.2365 10 11 12 averages.append(battingAverage) Results e 13 Minimum batting average is 0.157 14 # Assign the first element in the array to be the minimum and Maximum batting average is 0.333 the maximum. Average batting average is 0.236 15 minAverage = averages[0] 16 maxAverage = averages[0] Show Details 17 # Start out your total with the value of the first element in the array. Test Case • Incomplete 18 total = averages[0] 19 # Write a loop here to access array values starting with averages[1] Output Test 2 20 Run checks A Submit 66% 21 # Within the loop test for minimum and maximum batting averages
List Basics in Python<br>Tasks<br>BattingAverage.py<br>>_ Terminal<br>20<br>Enter a batting average: .242<br>21 # Within the loop test for minimum and maximum batting<br>0.3<br>averages.<br>22 for i in range(1, MAX_AVERAGES):<br>if averages[i] < minAverage:<br>minAverage = averages[i]<br>if averages[i] > maxAverage:<br>maxAverage = averages[i]<br>total += averages[i]<br>0.333<br>0.29<br>23<br>0.157<br>24<br></><br>0.3<br>25<br>0.27<br>26<br>0.269<br>27<br>0.242<br>28<br>Maximum batting average is 0.333<br>29 # Also accumulate a total of all batting averages.<br>30<br>Minimum batting average is 0.157<br>31<br>Average batting average is 0.270125<br>32 # Calculate the average of the 8 batting averages.<br>33 average = total / MAX_AVERAGES<br>34<br>Results e<br>35 # Print the batting averages stored in the averages array.<br>Minimum batting average is 0.157<br>36 for avg in averages:<br>Maximum batting average is 0.333<br>37<br>print(avg)<br>Average batting average is 0.270<br>38<br>39 # Print the maximum batting average, minimum batting average,<br>and average batting average.<br>40 print('Maximum batting average is '<br>41 print('Minimum batting average is '<br>42 print('Average batting average is<br>Show Details<br>+ str(maxAverage))<br>+ str(minAverage))<br>+ str(average))<br>Run checks<br>A Submit 66%<br>43<br>

Extracted text: List Basics in Python Tasks BattingAverage.py >_ Terminal 20 Enter a batting average: .242 21 # Within the loop test for minimum and maximum batting 0.3 averages. 22 for i in range(1, MAX_AVERAGES): if averages[i] < minaverage:="" minaverage="averages[i]" if="" averages[i]=""> maxAverage: maxAverage = averages[i] total += averages[i] 0.333 0.29 23 0.157 24 0.3 25 0.27 26 0.269 27 0.242 28 Maximum batting average is 0.333 29 # Also accumulate a total of all batting averages. 30 Minimum batting average is 0.157 31 Average batting average is 0.270125 32 # Calculate the average of the 8 batting averages. 33 average = total / MAX_AVERAGES 34 Results e 35 # Print the batting averages stored in the averages array. Minimum batting average is 0.157 36 for avg in averages: Maximum batting average is 0.333 37 print(avg) Average batting average is 0.270 38 39 # Print the maximum batting average, minimum batting average, and average batting average. 40 print('Maximum batting average is ' 41 print('Minimum batting average is ' 42 print('Average batting average is Show Details + str(maxAverage)) + str(minAverage)) + str(average)) Run checks A Submit 66% 43
Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here