couldn't get this correct. I want to check the contents of the list for a set of values. I should not be falling inside the conditional if because the value doesn't exist.
Following list contains: ['pm_pmdo', 'pm_pmco', 'shv', 'dsv', 'pmv']
Checking for the following: she, dse, pme
inside found one?
class newfunc(object): def testfunction(self): self.DSE = 'dse' self.PME = 'pme' self.SHE = 'she' self.users_roles = ['pm_pmdo', 'pm_pmco', 'shv', 'dsv', 'pmv'] print 'Following list contains:' print self.users_roles print 'Checking for the following:' print self.SHE print self.DSE print self.PME if (self.DSE or self.PME or self.SHE for s in self.users_roles): #if (self.DSE or self.PME or self.SHE) in self.users_roles: print "inside found one" else: print "outside none found" if __name__ == '__main__': runtime = newfunc() runtime.testfunction()