# Dictionary practice # Create a rectangular shape path = [ [1,1], [1,-1], [-1,-1], [-1,1], [1,1] ] print "path is ", path # Define special points as a dictionary points = { "tr" : [1,1], "br" : [1,-1], "bl" : [-1,-1], "tl" : [-1,1], "c" : [0,0], "tc" : [0,1], "rc" : [1,0], "bc" : [0,-1], "lc" : [-1,0] } # Create the rectangle dictionary rectangle = { "path" : path, "points" : points} # Create the shapes dictionary shapes = {"rectangle" : rectangle} print "Shapes : " print shapes print "Rectangle points :" for k in shapes["rectangle"]["points"].keys() : print k, shapes["rectangle"]["points"][k] print