It's the same computation. But this is a nice way of writing it, often called defensive programming.
这跟原来的计算过程没什么不同,但这是写代码的更优秀的一种方式。
麻省理工公开课 - 计算机科学及编程导论课程节选
应用推荐
模块上移
模块下移
不移动