In Python, what must follow the in keyword in a for loop?
In a Python for loop, the in keyword is followed by an iterable object, such as a list, string, tuple, dictionary, set, or range() object.
Example:
for name in ['Alice', 'Bob', 'Carol']:
print(name)
Here, ['Alice', 'Bob', 'Carol'] is the iterable object. Python's documentation explains that a for statement iterates over the items of a sequence or other iterable object.
Therefore, the correct answer isB. An iterable object.
Zack
16 days ago