1/40
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What do functions take?
It takes inputs and runs codes using those inputs.
How do you define a function?
def function name (parameter1, parameter2…).
What are parameters?
Input variables of a function.
All code inside your function must be indented below your function definition.
True
You can call a function with arguments after it is defined.
True
What is an argument?
Arguments specify the values of the parameters when a function is called.
You must have exactly as many arguments as parameters, and in the correct order.
True
What is a console?
The console is where python informs you of any errors in your code.
What is a syntax error?
A syntax error is a mistake in the program where the rules of the programming language are not followed.
What is a runtime error?
A runtime error is a mistake in the program that occurs during execution.
What is a logical error?
A logical error is a mistake that causes the program to behave incorrectly or unexpectedly.
When is onMousePress(mouseX, mouseY) called?
It is called every time the mouse is clicked.
When is onMouseRelease(mouseX, mouseY) called?
It is called when the mouse is released.
What point is (mouseX, mouseY)?
It is the point where the mouse is clicked
What is the variable? c = Circle(200, 200, 100, fill='red')
c
What does this do? c.fill='blue'
It changes the color to blue.
All shapes have which position properties?
left, right, top, bottom, centerX, centerY
All shapes have these size properties.
width and height
borderWidth
positive numbers only
opacity
numbers between 0 and 100
dashes
True or False
fill and border
properties that change color
What can you use with rotate angle?
numbers only
What do you put after visible to see if it is true or false?
true, false
What are custom properties?
Custom properties are variables that belong to a specific shape.
What is myPerson.hunger = 50 creating?
A custom property for your myPerson shape.
Use if (condition): and indent code
True
Use else: after an if statement
True
x == y
Is x equal to y?
x != y
Is x not equal to y?
x < y
Is x less than y?
x > y
Is x greater than y?
x <= y
Is x less than or equal to y?
x >= y
Is x greater than or equal to y?
What does elif do?
It lets you have more than one condition to check.
elif requires an if statement first
True
Are shapes a type of object?
Yes
In app.background and app.stop(), what are the objects?
app
What does shape.toFront() do?
Moves that shape to the top layer.
What does shape.hits(mouseX, mouseY) do?
Tests whether a point is hitting the shape; returns True or False.
What does shape.hitsShape(otherShape) do?
Tests whether that shape is hitting another shape