1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Paladinen [302]
3 years ago
6

Create a program that draws a rectangle whenever you click the mouse. The rectangle should have a width of 30 and a height of 50

and be centered at the place where the user clicks. Remember, the position of a rectangle is the top left corner. To place the rectangle at the center of the click, you will need to adjust the position.
Computers and Technology
1 answer:
Alinara [238K]3 years ago
6 0

Answer:

RECT_HEIGHT = 50

RECT_WIDTH = 30

rect = Rectangle(50,30)

       

# random.choice returns a random value from the COLORS

# function will draw a rectangle at x, y

def draw_rect(x, y):

   rectangle = Rect(50, 30)

   rect.set_position(x, y)

   rect.set_color(Color.green)

   add(rect)

# Link to the mouse click event

   add_mouse_click_handler(draw_rect)

Explanation: Hope this works for you.

You might be interested in
I'm trying to move the figure a little away from, the column line and every time I move it and click ok it goes back to being be
Luba_88 [7]

Answer:

Try to click the center button layout.

Explanation:

8 0
3 years ago
A technician has a client’s laptop that is randomly shutting down. Which of the following is the FIRST step of the troubleshooti
Bad White [126]

Answer:

B

.Identify the problem

6 0
3 years ago
What is a URI (include example)
fenix001 [56]

Answer:

 URI is the uniform resource identifier and it is basically a sequence of the character which identify the physical and logical resources. The uniform resource identifier basically contain the predefined set of rules and syntax and also maintain the extensibility hierarchical schema.

There are basically two types of URI that are:

  1)  Uniform Resource Name (URN)

  2) Uniform Resource Locator (URL)

For example: HTTP protocol , file transfer protocol (FTP).

 

6 0
3 years ago
I love science its my favorite subject
Charra [1.4K]

Answer:

Nice!

Explanation:

i like physics and biology :)

4 0
3 years ago
Read 2 more answers
What do u mean by generation of computer
lesya [120]

Answer:

Generation in computer terminology is a change in technology a computer is/was being used. Initially, the generation term was used to distinguish between varying hardware technologies. Nowadays, generation includes both hardware and software, which together make up an entire computer system.

Explanation:

3 0
3 years ago
Other questions:
  • Use blank to prevent friends who have been drinking from driving
    14·2 answers
  • Why should you thank the customer after resolving an issue?
    7·2 answers
  • A forensics workstation consisting of a laptop computer with almost as many bays and peripherals as a stationary workstation is
    10·1 answer
  • You can tell a cell is the active cell when it has a
    14·2 answers
  • Which form of investigation aims at checking whether or not a target system is subject to attack based on a database of tests, s
    15·1 answer
  • 1. Which of the following statements are true about routers and routing on the Internet. Choose two answers. A. Protocols ensure
    9·2 answers
  • How to improve a poor game design puzzles
    11·1 answer
  • Which key combination should you use
    9·2 answers
  • Implement the ArrayMethod application containing an array that stores eight integers. The application should call the following
    12·1 answer
  • A. Mohit has bought a new laptop. The laptop is not working as no software is installed in
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!