Python program to check particular char is in list or not














































Python program to check particular char is in list or not



Look at the below code carefully.



Here we have list1 and char = 't' declared. We use 'in' keyword along with if condition to check if particular element is present or not. If yes then it will print Element found in list. Consider one thing it will always find the first element in search. Here we have 't' twice in list1 (at 2nd position and at 9th position) but when we search it will return the first element found i.e 2nd in above example.

Comments