Python in Keyword
In programming, a keyword is a “reserved word” by the language which conveys special meaning to the interpreter. It may be a command or a parameter. Keywords cannot be used as a variable name in the program snippet. Python language also reserves some of the keywords that convey special meaning. In Python, keywords are case sensitive.
The in keyword has two purposes:
- To check if a value is present in a list, tuple, range, string, etc.
- To iterate through a sequence in a for loop.
# Using if statement if ele in seq: statement(s) # Using for statement for ele in seq: statement(s)
G e e k s