>>> products = ["shoes", "shorts", "shirts"] >>> for product in products: ... print "<td>" + product + "</td>" ... <td>shoes</td> <td>shorts</td> <td>shirts</td>
>>> colors = {"sky" : "blue", "grass" : "green"} >>> for color in colors.keys(): ... print "The color of the %s is %s" % (color, colors[color]) ... The color of the grass is green The color of the sky is blue