2.2.1 Flashcards

1
Q

constant

A

identifier for a memory location used to store a value that cannot be changed while the program is running

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

DIV

A

divides and gives integer part of answer only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

MOD

A

divides and gives remainder part of answer only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

count controlled loops

A

-code repeats a set number of times
-number of iterations is known before loop starts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

example of a count controlled loop

A

for loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

condition controlled loop

A

-code repeats until a condition is true
-number of iterations is not known before loop starts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

example of a condition controlled loop

A

while loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

arrays

A

-a data structure that stores a collection of data values all under one name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is each piece of data in an array called?

A

an element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

how is each element in an array accessed?

A

by its index value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

how can you add an item to a list at a specified position?

A

.insert()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

how can you reverse the order of a list?

A

.reverse()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

lists

A

-used to store a list of values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what are lists enclosed in?

A

[]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what’s each item in a list separated by?

A

a comma

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

how can you add to an empty list?

A

.append