Check a user name and PIN code : List Two Dimension « List « Python






Check a user name and PIN code

Check a user name and PIN code
database = [
    ['A',  '1234'],
    ['B',  '4242'],
    ['C',  '7524'],
    ['D',  '9843']
]

username = raw_input('User name: ')
pin = raw_input('PIN code: ')

if [username, pin] in database: print 'Access granted'

           
       








Related examples in the same category

1.Nested list: two dimensionsNested list: two dimensions