AP Computer Science Principles: List Quiz - Dolan

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/57

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

58 Terms

1
New cards

List definition

An ordered collection of items stored in one variable

2
New cards

Python list indexing starts at

0

3
New cards

AP pseudocode list indexing starts at

1

4
New cards

Python first element index

0

5
New cards

AP pseudocode first element index

1

6
New cards

Python last element index

len(list) - 1 or -1

7
New cards

AP pseudocode last element index

length(list)

8
New cards

Python create a list

my_list = [1, 2, 3]

9
New cards

AP pseudocode create a list

myList ← [1, 2, 3]

10
New cards

Python access element at index i

my_list[i]

11
New cards

AP pseudocode access element at position p

myList[p]

12
New cards

Python update element

my_list[i] = value

13
New cards

AP pseudocode update element

myList[p] ← value

14
New cards

Python append

my_list.append(value)

15
New cards

AP pseudocode append

APPEND(myList, value)

16
New cards

Python insert

my_list.insert(i, value)

17
New cards

AP pseudocode insert

INSERT(myList, position, value)

18
New cards

Python remove by index

mylist.pop(i) or del mylist[i]

19
New cards

AP pseudocode remove

REMOVE(myList, position)

20
New cards

Python remove by value

my_list.remove(value)

21
New cards

AP pseudocode remove by value

Must loop and remove when found

22
New cards

Python list length

len(my_list)

23
New cards

AP pseudocode list length

length(myList)

24
New cards

Python for-each loop

for item in my_list:

25
New cards

AP pseudocode for-each loop

FOR EACH item IN myList

26
New cards

Python index loop

for i in range(len(my_list)):

27
New cards

AP pseudocode index loop

FOR i ← 1 TO length(myList)

28
New cards

Python slicing

my_list[start:end]

29
New cards

AP pseudocode slicing

Not supported

30
New cards

Check if value in Python list

value in my_list

31
New cards

Check if value in pseudocode

Loop and compare each item

32
New cards

Filtering definition

Creating a new list with selected items

33
New cards

Python filtering example

if condition: new_list.append(x)

34
New cards

Pseudocode filtering example

IF condition THEN APPEND(newList, x)

35
New cards

Accumulator pattern definition

Looping to build a total or count

36
New cards

Python accumulator

total += item

37
New cards

Pseudocode accumulator

total ← total + item

38
New cards

Python find min/max

min(list), max(list)

39
New cards

Pseudocode find min/max

Compare each item in a loop

40
New cards

Combining Python lists

new = list1 + list2

41
New cards

Combining pseudocode lists

Use APPEND in a loop

42
New cards

Parallel lists definition

Two lists where item positions match

43
New cards

Nested lists definition

Lists inside lists (matrix[row][col])

44
New cards

Python nested list access

matrix[r][c]

45
New cards

Pseudocode nested list access

matrix[r][c]

46
New cards

List mutation definition

Changes the list itself (append, remove)

47
New cards

List reassignment definition

Creates new list and reassigns variable

48
New cards

Python negative indexing

Allowed (e.g., list[-1])

49
New cards

Pseudocode negative indexing

Not allowed

50
New cards

Python common list methods

append, insert, pop, remove, sort, reverse, count, index

51
New cards

AP pseudocode list commands

APPEND, INSERT, REMOVE, length, list[position]

52
New cards

Off-by-one error definition

Mistake from starting at wrong index

53
New cards

Python loop range rule

0 to len(list)-1

54
New cards

Pseudocode loop range rule

1 to length(list)

55
New cards

APPEND meaning

Add to end of list

56
New cards

INSERT meaning

Add value at a specific 1-based position

57
New cards

REMOVE meaning

Delete item at given position

58
New cards

length(list) meaning

Number of items in list