The most Pythonic ways of checking if a value is within a list is to use the "in" keyword, for example, using your data - 5 in [2, 6, 5] Which will return True, as 5 is in the list. You can then use this in the following generic way - if variable in list:
do_things Where variable is the varible you wish to seek, and the list is the list you wish to search. Might I also suggest that you use the *tut...@*python*.org mailing list, where people are perhaps more ready to handle this sort of question.
-- http://mail.python.org/mailman/listinfo/python-list