Question
Purpose: Practice updating variables and working with the string data type Degree of Difficulty: Easy For this question, you will write a simple labelling program
Purpose: Practice updating variables and working with the string data type Degree of Difficulty: Easy
For this question, you will write a simple labelling program that allows the user to place a single text label anywhere on the canvas.
Your program should behave as follows: When the program starts: Display a blank, black canvas. Initialize the current location of the text label to be somewhere in the middle of the screen (although the user wont be able to see the label, as there is no text yet).
When the user presses a key: Add anything that the user types to the label being displayed). When the user clicks the mouse: Remove all text from the current label; set the label coordinates to be equal to the coordinates of the mouse.
You will need to use variables in this program to keep track of the position of the label, as well as the text of the label itself.
this is programming and language is python
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started