In this post we will where to use the keyword 'in' on our python scripts and get things done. Lets get started,
IN[1]
friends = ["Prathap", "Darwin", "Delli"]
print("Prathap" in friends)
OUT[1]
![](https://static.wixstatic.com/media/a27d24_a04c6df4e053474ebc7ddd37259a577f~mv2.png/v1/fill/w_980,h_551,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/a27d24_a04c6df4e053474ebc7ddd37259a577f~mv2.png)
Using the keyword in we can find out if an element is available in a list. From above we can see, there is a list named friends which contains element "Prathap" on validating it with keyword in inside print function True has been returned.
IN[2]
games_played = {"GOD 4", "Anthem", "Uncharted 4"}
user_game = input("Enter the Game you played : ")
print(user_game in games_played)
OUT[2]
![](https://static.wixstatic.com/media/a27d24_568d50b4854c4969b167b3d5e470b366~mv2.png/v1/fill/w_980,h_551,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/a27d24_568d50b4854c4969b167b3d5e470b366~mv2.png)
Similarly we can do the same not only on list but can be done on both tuples and sets as well.
IN[3]
Name = "Prathap Dominicsavio"
print("Prathap" in Name)
OUT[3]
![](https://static.wixstatic.com/media/a27d24_7b499958fc1443ae82f75e783a44bc66~mv2.png/v1/fill/w_980,h_551,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/a27d24_7b499958fc1443ae82f75e783a44bc66~mv2.png)
Finally we can also find whether a substring or character is available in string. From above a variable named Name has string "Prathap Dominicsavio" when we use in keyword to search substring "Prathap" it returns True.