Mistake in Python for Beginners course
I believe there is a mistake in the Python for Beginners course, in the Functions chapter, in 38.2 Practice. We had to remove the smallest and largest elements from the list and write out the sum of the remaining numbers. The largest element in the list is 1024, but it occurs twice. When I remove both occurrences, the result is considered invalid (sum is to small). The code shown in the solution removes only one maximum. data.remove(max(data)) data.remove(min(data)) I think the remove function for maximum should be called twice, or what I think is a better solution, it should be called using while. maximum = max(data) minimum = min(data) while maximum in data: data.remove(maximum) while minimum in data: data.remove(minimum) Do you agree with me?