Question Answered step-by-step How would I be able to answer step 3-5 in this Overview Module 4… How would I be able to answer step 3-5 in this OverviewModule 4 Assignment 2 features designing a program using pseudocode and then completing the program in Python using a list. M4Lab2 asks you to write a Drawing app in Python and Pygame using a list for the colors. Open the M4Lab2ii.py program in IDLE and save it as M4Lab2ii.py with your initials instead of ii. See Pip and Pygame Installation Guide for instructions in Module 4.If your command shell does not see Python, you need to set the path to Python in the system variables using the Module 1 guide M1 Installing and Checking Your Python Path. Your system needs to know where Python is installed.If you installed Python using the Module 1 guide and our textbook’s instructions on page 2, the Anaconda Python installer set the variables for you.Each lab asks you to write pseudocode that plans the program’s logic before you write the program in Python and to turn in three things: 1) the pseudocode, 2) a screenshot of the output, and 3) the Python program.InstructionsPseudocode and Python Program with ListsM4Lab2.txt has some of the code provided for a Drawing app in Python using Pygame. In your lab, write the rest of the code to perform the following tasks:Open the file called M4Lab2ii.py linked below these instructions in your M4 Content module in IDLE.Save as M4Lab2ii.py. Replace ii with your initials. [example for someone with the initials cc: M4Lab2cc.py]Complete Steps 1-6 within the M4Lab2 code’s comments.Run your program and draw using the left and right cursor buttons.If available, also draw with the center cursor buttons, also called the scroll wheel.Test your program with different colors and take a screenshot of your drawing.Save your pseudocode as M4Lab2ii.docx. Replace ii with your initials.Insert a screenshot of your program output in the pseudocode’s Word file. How to Complete Your M4 Assignment 2 Pseudocode & Python Program with ListsWrite your pseudocode and save it as M4Lab2ii.docx. Replace ii with your initials.Write your program and save it as M4Lab2ii.py. Replace ii with your initials.Take a screenshot of your program’s output and Insert it in M4Lab2ii.docxUpload both M4 Lab documents (Word and Python) to Upload to M4 Assignment 2 Pseudocode & Python Program Assignment Submission Folder. .import pygameimport random # optional for this program, but useful for random colors, such as# randcolor = random.randrange(0,255)pygame.init()# Defines the display size with a width and height of 600, 600size = width, height = 600, 600# Step 1: Define a colors list to describe 3 colors.# Hint, use their RGB number values screen = pygame.display.set_mode(size)# Draws the screen using the sizepygame.display.set_caption(“Click and drag to draw”)# Displays the title at the top of the draw screenkeep_going = True# The program continues unti you close the window and type exit() in the shell# Step 2: define a radius variable for your pen at 5, 10 or 15# Test them to see which radius you prefer and use it. mousedown = False# we have not started drawing yetwhile keep_going != False: for event in pygame.event.get(): if event.type == pygame.QUIT: keep_going = False pygame.quit() if event.type == pygame.MOUSEBUTTONDOWN: mousedown = True if event.type == pygame.MOUSEBUTTONUP: mousedown = False if mousedown: # start drawing spot = pygame.mouse.get_pos() # locate the pen’s position as the 1st spot if pygame.mouse.get_pressed()[0]: # Boolean for button 1 button_color = colors[0] # selects the first color from the list # Step 3: write the elif for pressing button 2, similar to button 1 # Step 4: write the statement for button 2’s color # Step 5: write the else statement for button 3 # Step 6: choose a color from the list pygame.draw.circle(screen, button_color, spot, radius) # The pen is in the shape of a circle that draws on the screen # using the button color, the position of the spot, and the pen’s radius pygame.display.update() # You can draw until you close the Pygame windowpygame.quit()# Does the program continue to run?# Type print(keep_going) or another variable to test it. # The program ends after you type exit() in the Python shell.# For fun, try defining a random color and calling it for button_color# randcolor = random.randrange(0,255) Computer Science Engineering & Technology Python Programming CSC 119 Share QuestionEmailCopy link Comments (0)