Homework1
- Can assign a function directly
- no self-increment, use val+=1
- max or min function in Python can be given a lot of parameters
Homework2
- Nested Definitions
- Functions as Returned Values
Homework3
- use helper function in the function as a nested and the out funtion return an instance of it
- lambda expression's level: eg : (lambda f: lambda k: f(f, k))(lambda f, k: k if k == 1 else mul(k, f(f, sub(k, 1)))) here, we create a lambda expression which has 2 order (lambda f: lambda k: f(f, k)) and the follow (lambda f, k: k if k == 1 else mul(k, f(f, sub(k, 1)))) as the first parameter.
Cats
- res = [[] for _ in player_indices], to create 2 dimension list
- try to use abstraction as much as possible
- READ the text CAREFULLY
Homework4 very interest recursion and math problem!
Lab06 yield from recursion and yield
Ants Some useful OOP diagram
Homework5 OOP and generator( easy when we write recursive function first)
Lab07 HELP function defined in a function may be helpful to deliver arguments
Lab08
- The mutation of a data structure and assignment is different
- Recusive funtion is still need to improve