返回顶部

收藏

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-04-23 10:37:45List membership demo by 山药
  2. 2016-05-29 21:23:15A list of lists: nested list by Solon.Ring
  3. 2016-09-10 15:58:12Append multiple items to a list by 阿明娃儿
  4. 2016-10-12 16:14:02For loop for List by 张宋付
  5. 2016-11-17 15:09:59Variables in a list by 司马
  6. 2016-12-15 11:19:10Deleting List Elements by 山药
  7. 2012-11-22 01:39:16python列表操作extend和append的区别演示代码 by 睡到自然醒
  8. 2016-04-23 10:44:43List value assignment and index reference by xwz
  9. 2016-11-18 09:17:16List insert(i, x) by 山药
  10. 2017-03-05 14:32:17List comprehensions: for and tuple by Solon.Ring
  11. 2017-03-24 13:05:53Same Object or identical content by xwz

发表评论