Ahh, you are right, I didn’t read the full tutorial, because I never did it.
It looks like there is a problem with the tutorial, the parentheses in the SQL query string should be omitted if the rest of the python code is going to stay the same, where it states:
Here is an example of PostgreSQL behavior using this postgreSQL website you can use to interactively try out PostgreSQL queries :