Python for Keyword
Definition and Usage
The for keyword is used to create a for loop.
It can be used to traverse sequences, such as lists, tuples, etc.
More Examples
Example
Traverse each item in the list:
fruits = ["apple", "banana", "cherry"] for x in fruits: print(x)
Related Pages
Use break Keyword Interrupt the loop.
Use continue Keyword End the current iteration but continue the next one.
Please visit our Python For Loop Learn more about loops in the tutorial.