Education and Didactics

   

Reduce () in Python 3

Authors: K. S. Ooi

Python, the most popular language at this moment, is the language of choice to write readable code. As coding instructors, it is our virtue to teach students to write code that is easy to read and understand. However, Python was older than Java. There are functional programming components that survive, and many students find them too cool to ignore. I address one such higher-order function, reduce(), in this article. Over-reduce() is the first issue I discuss. If we understand the problem well and do not shoehorn our problem into reduce(), there are alternatives readily available. In this article, I gives few examples that we should not reduce().

Comments: 8 Pages.

Download: PDF

Submission history

[v1] 2020-12-25 13:20:37

Unique-IP document downloads: 360 times

Vixra.org is a pre-print repository rather than a journal. Articles hosted may not yet have been verified by peer-review and should be treated as preliminary. In particular, anything that appears to include financial or legal advice or proposed medical treatments should be treated with due caution. Vixra.org will not be responsible for any consequences of actions that result from any form of use of any documents on this website.

Add your own feedback and questions here:
You are equally welcome to be positive or negative about any paper but please be polite. If you are being critical you must mention at least one specific error, otherwise your comment will be deleted as unhelpful.

comments powered by Disqus