1/6
Flashcards on Python for loops
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
For loop
A control flow statement that allows you to iterate over a sequence of values, such as a list, tuple, or string.
for
The keyword used to construct a for loop in Python.
For loop and strings
Used to iterate through a string, assigning each character to a variable in turn.
For loop and lists
Iterates through each element in a list, with the loop variable taking on the value of the current element in each iteration.
split() method
A method used to split a larger block of text into smaller chunks, returning a list of strings.
Processing text with loops
Splits a sentence into words, capitalizing those with a length of 4 characters.
isdigit() method
A method that checks if a character is a digit.