小练习2

来源:互联网 发布:数据库原理概论pdf 编辑:程序博客网 时间:2024/05/23 14:52




脚本内容:


 

#!/usr/bin/env python#coding:utf-8__author__ = "sunner"'''@author:sunner@time:@desc:'''import stringuser = ['sunner','cat','root','student' ]passwd = ['hello','hello','hello','hello' ]list1 = []NOTE = '''                            #######用户管理#######    (C)reate : 创建用户    (L)ogin : 登陆用户        ####################'''print NOTEwhile True: C = raw_input("请输入你的选择(C/L):") C1 = C.upper() if C1 == "C" :a = raw_input("请输入你要建立的用户:")if a not in user[]:user.append(a)print userb=raw_input("请输入用户密码:")   passwd.append(b)    print passwdelif:print (" 错误:你所建立的用户已存在 !") elif:num = 0while num < 3:        if username == user and passwd == password:                print "Welcome to user manage system "                break        else:                print 'username or password worry !'num += 1



原创粉丝点击