Python Lists Vocabulary Flashcards

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/23

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards defining Python list operations, methods, functions, slicing techniques, and error handling based on the classroom material.

Last updated 9:43 AM on 10/5/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

24 Terms

1
New cards

List Indexing

Accessing an item at a specific position using square brackets, such as numbers[1] to retrieve the second item in a list.

2
New cards

append()

A list method that adds a single item or object to the end of a list, such as numbers.append(40).

3
New cards

extend()

A list method that adds each item from an iterable (such as another list) to the end of the list.

4
New cards

append() vs. extend()

append() adds one single item to the end (which can be a nested list like [3, 4]), whereas extend() iterates through a collection and adds each item individually.

5
New cards

Negative Indexing

Accessing items relative to the end of the list using negative integers, where numbers[-1] gets the last item and numbers[-2] gets the second-to-last item.

6
New cards

List Slicing [start:stop]

Extracting a subset of a list starting at index start up to, but not including, index stop (e.g., numbers[1:4]).

7
New cards

List Item Assignment

Modifying a list in place by assigning a new value to a specific index, such as numbers[1] = 50.

8
New cards

len()

A built-in function that returns the total number of items in a list.

9
New cards

max()

A built-in function that returns the largest element in a list.

10
New cards

min()

A built-in function that returns the smallest element in a list.

11
New cards

Omitted Slice Start [:stop]

Slicing syntax that defaults to starting from index 0 up to, but not including, the stop index (e.g., numbers[:2]).

12
New cards

Omitted Slice Stop [start:]

Slicing syntax that starts at the start index and includes all remaining items through the end of the list (e.g., numbers[1:]).

13
New cards

Step Slicing [::step]

Slicing syntax that extracts items at regular intervals based on a step value (e.g., numbers[::2] gets every second item).

14
New cards

remove()

A list method that deletes the first occurrence of a specified value from a list.

15
New cards

pop()

A list method that removes and returns an item from a list (defaults to removing the last item if no index is specified).

16
New cards

insert()

A list method that places a new item at a specific index, shifting existing items to the right (e.g., numbers.insert(1, 15)).

17
New cards

sort()

A list method that rearranges elements in place in ascending numerical or alphabetical order.

18
New cards

reverse()

A list method that reverses the elements of a list in place.

19
New cards

in operator

A membership operator that returns True if a value is present in the list and False otherwise.

20
New cards

IndexError: list index out of range

An error raised when attempting to access an index that exceeds the valid bounds of a list (e.g., accessing numbers[3] on a 3-element list).

21
New cards

AttributeError (lists)

An error raised when invoking a method that does not exist on lists, such as numbers.add(40) instead of numbers.append(40).

22
New cards

TypeError (list indexing)

An error raised when attempting to call a list using parentheses () instead of indexing with square brackets [].

23
New cards

Out-of-Bounds List Slicing

Slicing with a stop index beyond the list length (e.g., numbers[1:5]) which executes safely without throwing an error and returns available items.

24
New cards

ValueError (list remove)

An error raised when calling remove() on a value that does not exist in the list (e.g., numbers.remove(50)).