More fixes in the Python sample backend

the trailing comma is not necessary for lists, only for tuples with a single element.