import pygame # Homework: draw a rectangle using color variables. # 1. Define at least two color variables as (r, g, b) tuples. # 2. Use pygame.draw.rect() to draw a rectangle with one of them. # 3. Draw a second rectangle at a different position using the other color. # 4. Give the window a background color that is different from both rectangles. pygame.init() screen = pygame.display.set_mode((640, 480)) pygame.display.set_caption("Colored Rectangles") # TODO: define your color variables here # EXAMPLE: # MY_COLOR = (100, 200, 50) running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False # TODO: fill background and draw your rectangles screen.fill((30, 30, 30)) pygame.display.flip() pygame.quit()