polygons = [ [[1,7], [1,3], [2,3], [2,7]], # polygon 1 [[1,1], [1,5], [3,3]], # polygon 2 [[0,0], [0,5], [2,10], [4,7], [3,10], [8,2]] # polygon 3 ] for polygon in polygons: if len(polygon) < 3: print "This is not a polygon!" elif len(polygon) == 3: print "This is a triangle" elif len(polygon) == 4: print "This has four sides (might be a square?)." else: print "This is a more complex polygon."