DAY9(PYTHON)

li=[{'usename':'xiaowang'},
{'password':''}
]
board=['张三','李四','王大麻子']
while 1:
usename = input('用户名:')
if usename.upper()=='Q':break
password = input('密码:')
for i in board:
if i in usename:
usename=usename.replace(i,'*'*len(i))
li.append({'usename':usename,'password':password})
print({'usename':usename,'password':password})
print(li)

注意:  for i in board:

      if i in usename:

         usename=usename.replace(i,'*'*len(i))

上一篇:Gradle2.0用户指南翻译——第二章. 概述


下一篇:Caching漫谈--关于Cache的几个理论【转】