This page is under construction.
These problems are designed to be around exam difficulty. For more basic problems, see the topic-based guides and practice problems!
What would Python print?
The code above is loaded into the Python interpreter. What would the following lines output? Assume they are entered one after the other in the same environment. If there is no output, leave the space blank. If the code causes an error, write Error and describe in a few words what caused it.
>>> this(sub, d)() Error, second function call missing an argument >>> this(print, 40)(d) 40 30 >>> this(lambda x, y : y, d)(20) 20 >>> that(d, 0)(sub) 30
<\function ...> >>> other = that(10, this)(print) >>> other() 10 5