
Understanding Event Functions and onStep in Python
Authored by Keith Lavigne
Computers
9th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the onStep function?
To handle mouse click events.
To execute code once per second as defined by app.stepsPerSecond.
To define the color of shapes.
To initialize the application.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many times does onStep run if app.stepsPerSecond is set to 1?
Once per minute
Once per second
Twice per second
Ten times per second
3.
OPEN ENDED QUESTION
3 mins • 1 pt
Your CMU CS Academy app has defined app.shapes as a python list.
Assume that the following local variables have appropriate values stored in them:
leftX, topY, wth, hgt
define an appropriate function that adds a new rectangle object to the list when the mouse is released.
Evaluate responses using AI:
OFF
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The function definition for onMouseRelease is:
def onMouseRelease(mouseX, mouseY):
What data is accessible locally inside the function's implementation?
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In python, which method is calledto add data to the end of a list?
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In computer programming, what is the meaning of the term mutability?
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In your CMU CS Academy App, you have declared a python list named app.shapes.
Each time the onStep function triggers, you want to traverse the entire list of shapes. What code would your write to make this happen?
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?