I am very new to Qgis platform and I used a piece of code that I took from coockbook to iterate over all the polygons in a layer. But it is always showing me an error "