返回顶部

收藏

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'

标签:Python,List

收藏

0人收藏

支持

0

反对

0

»更多 您可能感兴趣的代码
  1. 2016-08-18 11:33:58List: less,equal,greater: tuple of results by 司马
  2. 2015-11-28 13:48:00Loop through a list: for in by 阮小七
  3. 2016-02-03 09:55:02Define a function to construct list by 山药
  4. 2016-08-18 11:45:27Find Prime numbers using list by 山药
  5. 2016-08-18 11:56:41List count(x) by 风云轩
  6. 2016-09-07 14:18:59Reference index in a list in Python. by wubai
  7. 2012-12-28 16:36:03python list使用技巧总结 by DuLinRain
  8. 2016-01-09 09:02:42List append(x) by 张宋付
  9. 2016-01-18 18:13:30test for List membership with in by 蟋蟀MM
  10. 2016-02-19 18:26:46List concatenation: speed by 司马
  11. 2016-03-05 09:58:39Assignment to slices: Replace some items by 司马

发表评论