users = { 'num1' :{ "name" : "admin" , "passwd888" : "admin" , "sex" : "1" },} |
list1 = [] |
for name,info in users.items(): |
for key,value in info.items(): |
list1.append(value) |
print ( "用户注册之前信息:" ,users) |
print ( "********************用户的创建********************" ) |
print ( '注册' .center( 50 , '*' )) |
name = input ( '请输入注册姓名:' ) |
if not name in list1[ 0 ]: |
passwd = input ( '请输入注册密码:' ) |
sex = input ( "请输入性别:0表示‘女’,1表示‘男’:" ) |
users[ "num2" ] = { "name" :name, "passwd" :passwd, "sex" :sex} |
print ( "新用户注册成功!" ) |
print ( "新用户注册成功后的信息:" ,users) |
else : |
print ( "该用户名已注册,对不起!" ) |