Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 import pygame 2 import sys 3 import random as rn 4 5 pygame. init) 6 7 BLACK= ( 0,0,0) 8 WHITE = (255,255,255) 9

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

1 import pygame 2 import sys 3 import random as rn 4 5 pygame. init) 6 7 BLACK= ( 0,0,0) 8 WHITE = (255,255,255) 9 BLUE = (0,0,255) 10 RED(255,0,0) 11 YELLOW= (255,255,0) 12 13 class Rectangle: 14 15 def-init-(self,color,loc): 16 17 18 19 def my_draw(self,screen) 20 self. loc = loc self.color color pygame.draw.rect(screen, self.color, self.loc) 1 import pygame 2 import sys 3 import random as rn 4 5 pygame. init) 6 7 BLACK= ( 0,0,0) 8 WHITE = (255,255,255) 9 BLUE = (0,0,255) 10 RED(255,0,0) 11 YELLOW= (255,255,0) 12 13 class Rectangle: 14 15 def-init-(self,color,loc): 16 17 18 19 def my_draw(self,screen) 20 self. loc = loc self.color color pygame.draw.rect(screen, self.color, self.loc)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions