Chapter 3 Flashcards

(24 cards)

1
Q

What is iteration?

A

Repeating steps using loops

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

What is an indefinite loop?

A

A loop that keeps going until a condition is false

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

What is a definite loop?

A

A loop that runs a set number of times

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

What does a while loop do?

A

Repeats while a condition is true

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

What does a for loop do?

A

Repeats a set number of times

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

What can cause an infinite loop?

A

The loop’s condition is always true

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

What is a list?

A

A group of items saved together

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

Where does indexing start on the AP test?

A

It starts at 1

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

Where does indexing start in Python?

A

It starts at 0

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

What does append() do to a list?

A

Adds something to the end

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

What does insert() do to a list?

A

Adds something at a certain spot

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

What does pop() do to a list?

A

Removes something from the list

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

What does len() tell you about a list?

A

The number of items in it

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

What is list slicing?

A

Getting a part of a list

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

What is a list traversal?

A

Going through a list one item at a time

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

How do you print all items in a list?

17
Q

How do you print every other item in a list?

A

Use a loop that skips by 2

18
Q

How do you print a list backwards?

A

Loop from the end to the start

19
Q

How do you add all numbers in a list?

A

Use a loop to add them

20
Q

How do you find the smallest number in a list?

A

Use a loop to check each one

21
Q

How do you find the biggest number in a list?

A

Use a loop to compare each

22
Q

How do you count how many numbers are negative?

A

Use a loop and count if less than 0

23
Q

How do you remove vowels from a word using loops?

A

Skip each letter that is a vowel

24
Q

How do you find where a value is in a list?

A

Loop and check the index