a block of code that performs some specific task; may or may not return a value; can be reused multiple times in the program
Function
an action on occurrence recognized by a program that is often originated from the external environment
Event
a mistake in a program's source code that results in incorrect or unexpected behavior (does not prevent the program from executing)
logic error
a mistake in the program that occurs during the execution of a program (math error)
run-time error
Circle (200, 200, 30, 50, fill = 'red')
Circle only needs 3 inputs (3 numbers)
(x, y, radius)
an error in the source code of a program (prevents the program from compiling or running - the most common error!)
syntax error
a value that is stored that can be accessed or changed by the program
Variable
a data type used to represent text that is often enclosed by quotation marks
String
a data type used to represent numeric values holding fractional numbers
Float
def onMousePress (mouseX, mouseY):
Circle (x, y, 20)
Needed to use mouseX and mouseY for my circle...
Changing a variable from one type to another
Type Casting
program code that is initiated by an event
Event handler
a data type used to represent numeric values holding whole numbers
Integer
A data type for variables and conditions that evaluates to either true or false (ex's: ==, <=, >)
Boolean
Rect (200, 200, 20, 20, fill = None, brder = 'blue')
brder = border
A statement that performs a specific action depending whether the Boolean condition evaluates to true or false (if)
Conditional Statement
Placeholder within a function for values
Parameter
Values of the parameters that are passed when a procedure is called
Argument
List 3 types of errors:
List 3 types of variables:
Logic, Syntax, Run-time
String, Integer, Float
def drawShape (radius, color):
Circle (180, 160, radius, fill = color)
drawShape ('red' , 20)
The arguments ('red' , 20) do not match the parameters (radius, color)