02_5.py 344 B

123456789101112131415161718
  1. #!/usr/bin/env python3
  2. # 成员资格
  3. href = 'www.baidu.com'
  4. print('.' in href)
  5. # Check a user name and PIN code
  6. database = [
  7. ['albert', '1234'],
  8. ['dilbert', '4242'],
  9. ['smith', '7524'],
  10. ['jones', '9843']
  11. ]
  12. username = input('User name: ')
  13. pin = input('PIN code: ')
  14. if [username, pin] in database: print('Access granted')