Posted on 27th April 2024
In operator is used for membership testing, which tells us if there is a value within the other value. For example, A in B returns true if there is a value called A within B, and when B does not contain A, it returns false.
Here is an example of a python program
My_example = "mindmajix is the best place to learn".
if 'mind' in My_example:
print("found the required string")
else:
print("there is no required string")
STILL GOT QUERIES?