Skip to content
CodeItRaw
Code Reading
/
Drop the Extremes
Path
Play
Daily
Leaderboard
tr
Break the Code
Drop the Extremes
Write a list for which this function gives the wrong answer.
1
def
trimmed_sum
(values):
2
low =
min
(values)
3
high =
max
(values)
4
return
sum
(v
for
v
in
values
if
v != low
and
v != high)