forExpert Playground

Starts a loop that iterates over a sequence or iterable

Python Playground
Output
Click "Run" to execute your code

for calls iter() to get an iterator, then repeatedly calls next() until StopIteration is raised. GET_ITER and FOR_ITER are the key bytecode instructions.

Challenge

Try modifying the code above to explore different behaviors. Can you extend the example to handle a new use case?