123k views
1 vote
9.5 Code Practice edhesive

2 Answers

2 votes

Answer:

a = [[34,38,50,44,39],

[42,36,40,43,44],

[24,31,46,40,45],

[43,47,35,31,26],

[37,28,20,36,50]]

sum=0

for r in range(len(a)):

for c in range(len(a[r])):

sum = sum + a[r][c]

print("Sum of all values: " + str(sum) + "\\\\")

print("Average of all values: " + str(sum / (len(a) * len(a))))

Step-by-step explanation:

Sum of all values: 949

Average of all values: 37.96

User Alex Szabo
by
4.4k points
4 votes

Answer:

a = [[34,38,50,44,39],

[42,36,40,43,44],

[24,31,46,40,45],

[43,47,35,31,26],

[37,28,20,36,50]]

sum=0

for r in range(len(a)):

for c in range(len(a[r])):

sum = sum + a[r][c]

print("Sum of all values: " + str(sum) + "\\\\")

print("Average of all values: " + str(sum / (len(a) * len(a))))

Step-by-step explanation:

I got 100%.

User POIR
by
4.0k points