"""Samara Lopez January 28, 2026 Python HW Week 02""" # TODO 1: Put all your variable assignments here. squareX = random(10,300) squareY = squareX squareExtent = random (20, 400) opacityR = random (0,100) ellipseX = 200 ellipseY = 200 opacityEllipse = random (0,100) eHeight = random (50, 200) eWidth = random (50, 200) def setup(): size(400,400) # size() goes inside setup() here. Like this: # Optional: If your sketch from the previous part used background(), # put that here. It should have 4 spaces of indentation noLoop() def draw(): background (random(0,255),random(0,255),random(0,255)) global squareX squareX = random(10,300) squareY = squareX global squareExtent squareExtent = random (20, 400) global opacityR opacityR = random (0,100) global ellipseX ellipseX = random (10,200) global ellipseY ellipseY = random (10,200) global opacityEllipse opacityEllipse = random (0,100) global eHeight eHeight = random (50, 200) global eWidth eWidth = random (50, 200) # TODO 2: Put each of your variables here on their own line # and mark each as 'global'. (I will explain what this # means next week.) And assign each one a random value # using a low, high range that works reasonably within # your composition. You should have 4 spaces of indendation. # For example: # global treeHeight # treeHeight = random(50,250) # TODO 3: Now copy/paste all your draw code here (ie, the code # that uses those variables). All of the code here should # have 4 spaces of indentation. #CYAN SQUARE stroke(0,0,0) fill(0,255,255, opacityR) square(squareX,squareY, squareExtent+10) #MAGENTA SQUARE stroke(0,0,0) fill(255,0,255, opacityR) square(squareX, squareY, squareExtent) #YELLOW SQUARE stroke(0,0,0) fill(255,255,0,opacityR) square(squareX, squareY, squareExtent-10) #ELLIPSE stroke (0,0,0) fill(0,0,0,opacityEllipse) ellipse(ellipseX,ellipseY,eWidth, eHeight) # NOTE: If you are using background(), remove it for now, or move # it into the setup area, above. # TODO 4: Go through your code and for every place you are setting # a color, add some transparency. For example, if your code # has this: # fill(255,0,0) # modify it to something like this: # fill(255,0,0,10) # TODO 5: run your sketch and see what happens! # The idea here is that if you do the above, you should hopefully # get something that looks like the Idris Khan image compositions. # Do you? This is a lead-in to the topic for next week, and I will # explain more about it then.