Q30Numerical4 Marks11 Dec 2022
Consider the following snippet of code.
```
while len(L) > 2:
val_1 = L[0]
for x in L:
if x > val_1:
val_1 = x
L.remove(val_1)
val_2 = L[0]
for x in L:
if x < val_2:
val_2 = x
L.remove(val_2)
print(sum(L) // len(L))
```
What will be the output of the code given above for L = [1, 9, 2, 8, 3, 7, 5, 4, 6]?
Press Enter to check.