Topic 7 Anonymous Functions
You’ve learned about functions in Python - blocks of organized, reusable code that do something. You also know that in Python, we use the keyword def
to define a function like so:
def makeMatrix(nrow, ncol):
return [(['o'] * ncol) for i in range(nrow)]
However, I think another variant of functions - an anonymous funciton - may be worth considering during the final projects or even during the CAs!