Python Variables & Core Data Structures – Vocabulary Review

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/51

flashcard set

Earn XP

Description and Tags

A comprehensive set of vocabulary flashcards covering Python variables, strings, lists, tuples, sets, and dictionaries to aid exam preparation.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

52 Terms

1
New cards

Variable

A named container that stores a value in memory for later use.

2
New cards

Dynamic Typing

Python’s ability to infer a variable’s data type at assignment time without explicit declarations.

3
New cards

Integer Variable

A variable holding a whole-number value such as 5 or −3.

4
New cards

Float Variable

A variable storing a decimal number like 3.14.

5
New cards

String Variable

A variable whose value is text enclosed in quotes, e.g., "hello".

6
New cards

String Concatenation

Joining two or more strings together using the + operator.

7
New cards

String Indexing

Accessing individual characters in a string by position using square brackets.

8
New cards

Zero-Based Indexing

Counting string (or list) positions starting at 0 for the first element.

9
New cards

Negative Index

An index that starts from −1 for the last element and moves leftward.

10
New cards

String Slicing

Extracting a substring with syntax [start:stop].

11
New cards

Slice Omission

Leaving out start or stop in a slice to imply the beginning or end of the sequence.

12
New cards

String Immutability

Property that prevents changing individual characters of an existing string.

13
New cards

len() Function

Built-in that returns the number of items in a string, list, or other container.

14
New cards

List

An ordered, mutable collection defined with square brackets [].

15
New cards

Heterogeneous List

A list containing elements of different data types.

16
New cards

Nested List

A list that contains one or more lists as its elements.

17
New cards

List Indexing

Retrieving a single list element by its numeric position.

18
New cards

List Negative Indexing

Using −1, −2, etc., to access elements from the list’s end.

19
New cards

List Slicing

Getting a sublist with the [start:stop] notation.

20
New cards

List Mutability

Characteristic allowing list contents to be changed after creation.

21
New cards

append()

List method that adds a single element to the end.

22
New cards

insert()

List method that adds an element at a specified index.

23
New cards

remove()

List method that deletes the first occurrence of a specified value.

24
New cards

pop()

List method that removes and returns an element by index (last if none given).

25
New cards

del Statement

Keyword that can delete list elements or slices by index range.

26
New cards

clear()

List method that empties all elements from the list.

27
New cards

extend()

List method that adds each element from an iterable to the list.

28
New cards

min()

Built-in that returns the smallest element in a list.

29
New cards

max()

Built-in that returns the largest element in a list.

30
New cards

sum()

Built-in that totals numeric elements in a list.

31
New cards

sort()

List method that orders elements in ascending order in place.

32
New cards

Tuple

An ordered, immutable sequence defined with round brackets ().

33
New cards

Tuple Immutability

Quality that prevents any change to a tuple’s contents after creation.

34
New cards

Tuple Methods

Limited operations count() and index() that do not modify the tuple.

35
New cards

Tuple Performance Benefit

Faster iteration versus lists due to immutability optimizations.

36
New cards

Set

An unordered collection of unique elements defined with curly braces {}.

37
New cards

Unordered Set

Set characteristic that does not preserve insertion order.

38
New cards

Unique Elements

Rule that prohibits duplicate values within a set.

39
New cards

Hashing

Internal mechanism allowing sets fast membership tests and lookups.

40
New cards

add() (set)

Method that inserts a new element into a set.

41
New cards

remove() (set)

Method that deletes a specified element from a set; raises error if absent.

42
New cards

pop() (set)

Method that removes and returns an arbitrary element from a set.

43
New cards

Set Membership Test

Using the in keyword to check if a value exists in a set.

44
New cards

No Indexing in Set

Sets lack positional access because they are unordered.

45
New cards

Dictionary

A mutable collection of key-value pairs defined with curly braces {key: value}.

46
New cards

Key-Value Pair

The fundamental element of a dictionary linking a unique key to its value.

47
New cards

Immutable Key

Requirement that dictionary keys be unchangeable types such as strings or numbers.

48
New cards

.get() Method

Dictionary method that safely retrieves a value and returns a default if the key is missing.

49
New cards

zip() to dict

Technique that pairs two lists and converts them into a dictionary using dict(zip()).

50
New cards

Adding Dictionary Entry

Assigning a value to a new key using dict[key] = value.

51
New cards

del Keyword (dictionary)

Command that deletes a key-value pair from a dictionary.

52
New cards

Nested Dictionary

A dictionary that stores another dictionary (or list) as a value for hierarchical data.