vendredi 26 février 2016

Can I use a wildcard to search a list in python 2.7?

I have a list where the items in the list have a complicated construction ( A concatenation of strings from different variables created elsewhere in the program). I would like to search for part of the string in the list using an "if i in list" type function. Can I do this? If so what is the syntax?

Additional info: the string I'd like to search for in the list item is around 500 characters long and held in a variable. In the list items there are \t and \n plus other string characters as eventually these list items are output into a text file list.

Aucun commentaire:

Enregistrer un commentaire