NEW
Font size
WorksheetsPython 201 Lessons 6-9 Vocab
Total questions: 21
Worksheet time: 11mins
A set of code that repeats while a certain condition is true. The loop will end when the condition becomes false.
While Loop
Iteration
Iterator Variable
Accumulator Variable
Infinite Loop
A single repetition of a loop. We often talk about loops in terms of the number of iterations that it has.
While Loop
Iteration
Iterator Variable
Accumulator Variable
Infinite Loop
The variable that stores a value which will determine the number of iterations. This variable must be initialized before the loop starts and will be used in the condition of the while loop. The variable must also be incremented inside the while loop to avoid an infinite loop.
While Loop
Iteration
Iterator Variable
Accumulator Variable
Infinite Loop
A loop that will repeat forever, usually due to the iterator variable not being incremented. You want to avoid these as much as possible as they will crash the website.
While Loop
Iteration
Iterator Variable
Accumulator Variable
Infinite Loop
A variable defined outside of a loop that accumulates a value during the loop. This is often used to calculate the sum or product of a series of numbers or variables.
While Loop
Iteration
Iterator Variable
Accumulator Variable
Infinite Loop
For a number "n", this is the product of all numbers between 1 and "n," including "n." This is written mathematically as "n!".
Factorial
Iteration
Iterator Variable
Accumulator Variable
Infinite Loop
Objects that cannot be modified after they are created. Strings are immutable and while strings cannot be manipulated, new strings can be formed with the changes applied.
Immutable
Index
Substring
"in" Operator
"not in" Operator
A position in a string or other object in Python. Indexes in Python start at 0 and increase by 1 as you move to the right. Python will produce an error if you try to access an invalid index, an index that is not in the string or object. In Python, you can also use negative indexes to reference the index from the end of the string.
Immutable
Index
Substring
"in" Operator
"not in" Operator
A sub-sequence of characters in a string. For example, "hello" is a substring of "hellogoodbye".
Immutable
Index
Substring
"in" Operator
"not in" Operator
A binary operator that will return True if the string on the left is in the string on the right. For example, ("hello" in "hello world") == True.
Immutable
Index
Substring
"in" Operator
"not in" Operator
A binary operator that will return True if the string on the left is not in the string on the right. Here is an example: ("z" not in "abcdefghijk") == True
Immutable
Index
Substring
"in" Operator
"not in" Operator
A sequence of characters (letters) enclosed in either double or single quotes. Multi-line strings can be written between three single quotes (''')
Immutable
Index
Substring
"in" Operator
String
