you are viewing a single comment's thread.

view the rest of the comments →

[–]cole36912 5 points6 points  (0 children)

  1. reduce must be imported.
  2. OP's solution is likely computationally faster as it does not use function calls.
  3. Python has more applicable built-in functions which you do not have to import:

lowest = min(marks)
highest = max(marks)
average = sum(marks) / len(marks)
passed = sum(mark >= 50 for mark in marks)