2.2.1 Flashcards
constant
identifier for a memory location used to store a value that cannot be changed while the program is running
DIV
divides and gives integer part of answer only
MOD
divides and gives remainder part of answer only
count controlled loops
-code repeats a set number of times
-number of iterations is known before loop starts
example of a count controlled loop
for loop
condition controlled loop
-code repeats until a condition is true
-number of iterations is not known before loop starts
example of a condition controlled loop
while loop
arrays
-a data structure that stores a collection of data values all under one name
what is each piece of data in an array called?
an element
how is each element in an array accessed?
by its index value
how can you add an item to a list at a specified position?
.insert()
how can you reverse the order of a list?
.reverse()
lists
-used to store a list of values
what are lists enclosed in?
[]
what’s each item in a list separated by?
a comma