Is there any equivalent 'LIKE' function(like in MySQL) for lists. for example;
This is my list:
abc = ['one', 'two', 'three', 'twenty one']
if I give the word "on", it should print the matching words from the list (in this case: 'one', 'twenty one') and if I give "fo", it should print False
You can use list comprehension:
This roughly translates to “for each element in abc, append element to a list if the element contains the substring ‘on'”