- 博客(4)
- 收藏
- 关注
原创 树(Tree)数据抽象
定义: A tree has a root label and a sequence of branches. Each branch of a tree is a tree. A tree with no branches is called a leaf. Any tree contained within a tree is called a sub-tree of that tree (such as a branch of a branch). The root of each sub-tree
2020-06-24 18:50:29
571
原创 Pytho中function call的执行顺序
看到一篇为文章讲的不错,主要顺序是: Evaluate operator Evaluate operand(s) Apply operator to operands a. Create a new frame b. Create arguments as local variables c. Execute the body of the function 这也解释了我第一篇文章中为什么不能用if_function替代 if else statement的问题 def if_function(c,t,
2020-06-17 20:15:47
295
原创 HW02 lambda函数的一个问题
阐述一个有关lambda函数的问题 首先定义accumulate函数 def accumulate(combiner, base, n, term): """Return the result of combining the first n terms in a sequence and base. The terms to be combined are term(1), term(2), ..., term(n). combiner is a two-argument com
2020-06-08 22:35:09
537
原创 HW1 Python中call expression的执行顺序
此笔记用 个例子解释python中call的执行顺序和相关environment的知识 第一个例子来源于HW01的Q4 Q4: If Function vs Statement Let’s try to write a function that does the same thing as an if statement. def if_function(condition, true_result, false_result): """Return true_result if condi
2020-06-06 21:58:53
1489
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人