Python Programming: References, Mutability, Recursion, and Pygame

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

1/20

flashcard set

Earn XP

Description and Tags

Vocabulary practice flashcards covering fundamental Python concepts including mutability, references, list comprehensions, recursion, string methods, file processing, and basic Pygame commands.

21 Terms

1
New cards

Equality Operator (==)

An operator that compares values to check whether two operands have equivalent values.

2
New cards

Identity Operator (is)

An operator that compares whether two variables reference the exact same object in memory.

3
New cards

Mutable Objects

Data types—such as lists and dictionaries—whose contents can be modified in place without changing their identity.

4
New cards

append()

A list method that modifies the existing list by adding an element to the end, rather than creating a new list.

5
New cards
  • Operator (List Concatenation)

An operation that combines two lists together by creating an entirely new list.

6
New cards

List Comprehension

A concise syntactic construct for creating a new list from an existing collection, structured as [new_expression for item in collection].

7
New cards

Recursion

A programming approach where the definition of a concept or process depends on a simpler or previous version of itself.

8
New cards

Base Case

The terminating condition in a recursive function that stops recursion without calling itself.

9
New cards

Recursive Case

The branch of a recursive function that calls itself with a smaller subproblem, making progress toward the base case.

10
New cards

Factorial

The product of an integer and all positive integers beneath it, calculated recursively as n!=n×(n−1)!n! = n \times (n-1)! with a base case of 0!=10! = 1.

11
New cards

Fibonacci Sequence

A sequence of numbers (1, 1, 2, 3, 5, 8, 13…) where each number is the sum of the previous two numbers.

12
New cards

Driver Function

A function that handles one-time setup and data preparation before delegating the core computation to a recursive function.

13
New cards

Immutable Objects

Data types—such as strings—whose values cannot be altered once created, preventing functions from modifying them in place.

14
New cards

Refactoring

The practice of updating and restructuring existing code to improve code quality without altering its functionality.

15
New cards

Call Stack

The memory region where parameters and local variables are allocated as stack frames each time a function is called.

16
New cards

Accumulator Loop

A programming pattern that iterates over a collection to update an accumulating variable (such as a running total or an appended list).

17
New cards

strip()

A string method commonly used in file processing to remove leading and trailing whitespace characters from a line.

18
New cards

split()

A string method that divides a string into a list of substrings separated by a given delimiter.

19
New cards

join()

A string method that concatenates elements of a list of words into a single string using a specified separator.

20
New cards

pygame.init()

The initialization method used at the start of a Pygame script to initialize all imported Pygame modules.

21
New cards

blit()

A Pygame method (e.g., screen.blit) used to draw or insert an image surface onto another surface at a specified position.