Python Revision Tour II Flashcards

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

1/59

flashcard set

Earn XP

Description and Tags

A comprehensive set of vocabulary flashcards covering basic Python string, list, tuple, and dictionary manipulations, built-in methods, and standard library modules like math, random, and statistics.

Last updated 7:32 AM on 6/14/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

60 Terms

1
New cards

String

In Python, a sequence of characters enclosed in quotes that can hold any type of known characters.

2
New cards

Immutable

A characteristic of strings and tuples meaning once they are created, the items or characters within them cannot be changed.

3
New cards

Forward Indexing

A memory location indexing method where the index starts from zero (00) and moves from left to right.

4
New cards

Backward Indexing

A memory location indexing method where the index starts from minus one (1-1) and moves from right to left.

5
New cards

Concatenation (++)

The operation of joining two or more strings or lists into one.

6
New cards

Replication (*)

An operator that creates multiple copies of a string or repeats the elements of a list a specific number of times.

7
New cards

Membership Operators (in and not in)

Operators that check if a specific character, substring, or value exists within a sequence, returning a Boolean value (TrueTrue or FalseFalse).

8
New cards

String Slicing

The process of extracting a substring or sub-list using the syntax [start : stop : step], where start is included and stop is excluded.

9
New cards

ord()ord( ) Function

A function that takes a single string character and returns its corresponding Unicode number.

10
New cards

chr()chr( ) Function

A function that takes an integer representing a Unicode value and returns its corresponding character.

11
New cards

len()len() Function

A built-in function that returns the total count of elements or characters in a string, list, tuple, dictionary, or set.

12
New cards

Traversing

The process of visiting every character or item in a sequence one by one from the beginning to the end.

13
New cards

capitalize()capitalize() Method

A string method that converts the very first character to uppercase and all other characters to lowercase.

14
New cards

title()title() Method

A string method that capitalizes the first letter of every word and converts remaining letters to lowercase, using spaces, hyphens, or quotes as separators.

15
New cards

count()count() Method

Used to find how many times a specific (case-sensitive) substring or element appears within a larger string or list.

16
New cards

find()find() Method

A string method that returns the index of the first occurrence of a substring, or 1-1 if the substring is not found.

17
New cards

index()index() Method

A method used with strings or lists to find the index of the first occurrence of a value; it raises a ValueErrorValueError if the item is not found.

18
New cards

isalpha()isalpha() Method

Returns TrueTrue if a string consists entirely of alphabetic characters (letters).

19
New cards

islower()islower() Method

Checks whether all alphabetic characters in a string are lowercase.

20
New cards

isdecimal()isdecimal() Method

Returns TrueTrue only for string characters that can be used to form numbers in base 1010 (00 through 99).

21
New cards

isdigit()isdigit() Method

Returns TrueTrue for all characters in a string that are digits, including superscripts and subscripts.

22
New cards

isnumeric()isnumeric() Method

Returns TrueTrue for any numeric representation in a string, including fractions and Roman numerals.

23
New cards

isspace()isspace() Method

Checks if a string consists only of whitespace characters such as standard spaces, '\t', '\n', '\v', '\r', or '\f'.

24
New cards

strip()strip() Method

A method used to remove leading and trailing whitespace or specific characters from a string.

25
New cards

replace()replace() Method

A string method that creates a new string by replacing all or a specific count of occurrences of a substring with another.

26
New cards

join()join() Method

Returns a new string by joining elements of an iterable (like a list or tuple) using a specified string separator.

27
New cards

partition()partition() Method

Splits a string into exactly three parts based on the first occurrence of a separator and returns them as a tuple.

28
New cards

split()split() Method

Breaks a string into a list of substrings based on a specified delimiter; if no delimiter is specified, it splits by any whitespace.

29
New cards

List

A mutable, ordered sequence data type that allows duplicate items and can contain heterogeneous data types.

30
New cards

enumerate()enumerate() Function

Returns the index and items from an iterable as a tuple, starting from zero (00) or a specified start parameter.

31
New cards

Shallow Copy

A copy created using the copy()copy() method or list()list() constructor where top-level items are independent, but nested lists remain shared between original and copy.

32
New cards

eval()eval() Function

Evaluates and returns the result of a mathematical expression or data structure given as a string.

33
New cards

append()append() Method

Adds a single item to the very end of an existing list and modifies it in-place.

34
New cards

extend()extend() Method

Adds multiple elements from an iterable individually to the end of a list.

35
New cards

insert()insert() Method

Adds an element to a list at a specific index by shifting existing items one position to the right.

36
New cards

pop()pop() Method

Removes and returns an item from a list based on an index; defaults to the last item if no index is provided.

37
New cards

deldel Statement

A Python keyword used to remove items by index/slice or delete an entire variable from memory; it does not return a value.

38
New cards

clear()clear() Method

Removes all items from a list or dictionary, leaving it completely empty.

39
New cards

sort()sort() Method

Arranges list elements in ascending or descending order in-place and returns NoneNone.

40
New cards

sorted()sorted() Function

Takes any iterable and returns a brand-new list containing the elements in sorted order.

41
New cards

sum()sum() Function

Calculates the total of all elements in a numerical list or tuple.

42
New cards

Nested List

A list that contains other lists as its individual elements.

43
New cards

Tuple

An ordered, immutable collection data type that is indexed and allows duplicate values.

44
New cards

Tuple Unpacking

A process that extracts values from a tuple and assigns them to multiple variables in a single line of code.

45
New cards

Dictionary

A mutable, ordered collection of unique key-value pairs where keys must be of an immutable data type.

46
New cards

.get().get() Method

Accesses a dictionary value by key without crashing; returns NoneNone or a specified default value if the key is missing.

47
New cards

.update().update() Method

A dictionary method used to change or add multiple items at once using another dictionary or iterable of pairs.

48
New cards

.items().items() Method

A dictionary method that returns a view of key-value pairs as tuples.

49
New cards

fromkeys()fromkeys() Method

Creates a new dictionary from an iterable of keys, assigning each key a specified value or NoneNone by default.

50
New cards

setdefault()setdefault() Method

Returns the value of a key if it exists; if not, it inserts the key with a specified default value and returns that value.

51
New cards

popitem()popitem() Method

Removes and returns the last key-value pair from a dictionary as a tuple.

52
New cards

Python Module

A file containing Python code (functions, classes, or variables) that can be imported to improve maintainability and reusability.

53
New cards

math.ceil(x)math.ceil(x)

A math module function that always rounds a number up to the nearest whole integer.

54
New cards

math.floor(x)math.floor(x)

A math module function that always rounds a number down to the nearest whole integer.

55
New cards

math.fabs(x)math.fabs(x)

Returns the absolute value of a number as a float, stripping away any negative sign.

56
New cards

random.randint(a,b)random.randint(a, b)

Returns a random integer between aa and bb, inclusive of both endpoints.

57
New cards

random.randrange(start,stop,step)random.randrange(start, stop, step)

Picks one random integer within a range where the stop value is exclusive.

58
New cards

statistics.mean()statistics.mean()

Calculates the average of a collection of numerical data by dividing the sum of all numbers by the count.

59
New cards

statistics.median()statistics.median()

Identifies the middle value in a sorted dataset; it averages the two center values if the count is even.

60
New cards

statistics.mode()statistics.mode()

Returns the value that appears most frequently in a dataset.