DLS 4 Week 2 A2 Exercise 2 -- been stuck for quite some time

Are you sure that you don’t have any trailing commas on any of the assignment statements? You have to be careful if you “copy/paste” things from the Sequential API to the Functional API. The two are fundamentally different. In the Sequential case, you need the commas, because what you are doing is creating a list. In the Functional case, if you put a comma at the end of the line, it makes the RHS of the assignment statement a tuple, which is not what you want and can result in errors like the one you show.

Here’s a thread which gives a nice introduction to the subtleties of the Sequential and Functional APIs.

1 Like