Pure Python: The in keyword

The in keyword has a number of uses. The two most used functions to check if a value is in a range of values, the other usage is used when traversing a tuple in a for loop.

A first example of using the in keyword is when checking for the existence of an element in a range or tuple:

Will print lambda is a keyword the keyword is in the (limited) set of Python keywords.

The same can be used for checking a keyword in a tuple (notice the round braces):

Also, the in keyword can be used when traversing a loop: