Module 2 - Strings and Lists, Conditionals and Loops

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

1/29

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

30 Terms

1
New cards

pop()

Removes and returns the element at the end of a list (or specific index)

2
New cards

Mutator methods

Methods that change the state of an object and usually return None

3
New cards

Modulo operator %

Returns the remainder of standard division between two numbers

4
New cards

abs()

Takes a number as input and returns its absolute value

5
New cards
While Loop
Conditional iteration that repeats statements as long as a condition remains true
6
New cards
Infinite Loop
A loop where the continuation condition never becomes false causing it to run forever
7
New cards
break statement
Command that causes an immediate exit from a loop body
8
New cards
continue statement
Command that skips the rest of the current iteration and jumps to the next one
9
New cards
random.randint(a b)
Function returning a random integer in the closed interval between a and b
10
New cards
Definite Iteration
Process of repeating an action a predefined number of times
11
New cards
For Loop
Control statement used to iterate over a sequence of elements
12
New cards
ord()
Function that returns the integer Unicode code point for a given character
13
New cards
chr()
Function that converts an integer code point into its corresponding character
14
New cards
range(stop)
Generates a sequence of numbers from 0 up to but not including the stop value
15
New cards
range(start stop step)
Generates a sequence from start to stop (exclusive) incrementing by step
16
New cards
Off-by-one error
Logic error where a loop iterates one time too many or too few
17
New cards
List
Ordered and changeable collection of elements accessible by index
18
New cards
Index
Integer position of an item in a sequence starting at 0
19
New cards
len()
Function that returns the number of items in a container like a list or string
20
New cards
append()
List method that adds a single element to the end of the list
21
New cards
extend()
List method that adds elements from an iterable to the end of the current list
22
New cards
insert(index element)
List method that places an element at a specific position
23
New cards
pop()
List method that removes and returns the element at a specific index
24
New cards
Mutator method
Method that modifies the internal state of an object and usually returns None
25
New cards
Modulo (%)
Operator that returns the remainder of a division operation
26
New cards
Immutable Object
Object type that cannot be modified after creation such as int or string
27
New cards
Method
Function associated with an object called using dot notation
28
New cards
Slicing
Extracting a portion of a sequence using start stop and step values
29
New cards
Negative Indexing
Accessing elements from the end of a sequence starting with -1
30
New cards
enumerate()

Function returning pairs containing a count and the value from an iterable