Use in to check Membership : List In « List « Python






Use in to check Membership

Use in to check Membership
permissions = 'rw'
print 'w' in permissions

print 'x' in permissions


users = ['mlh', 'foo', 'bar']

print 'foo' in users

           
       








Related examples in the same category

1.List membership demoList membership demo
2.test for List membership with in test for List membership with in