小练习2
来源:互联网 发布:今日头条视频推荐算法 编辑:程序博客网 时间:2024/05/29 19:03
#encoding=utf-8users=['mengke','songzhao']passwd=['hello','hello']administrationinfo={}time=3for i in range(len(users)): administrationinfo[users[i]]=passwd[i]notice='''\usage(C)reate(L)login'''print noticewhile(True): choice=raw_input("please chose a mode") if choice=='C': newuser=raw_input("please input the new name") for new in users: if new==newuser: print "the name is already existed" break else: users.append(newuser) newpasswd=raw_input("please input the new passwd") passwd.append(newpasswd) administrationinfo[newuser]=newpasswd print "success" break elif choice=='L': loginuser=raw_input("please input your name") while loginuser not in users: print "wrong" time-=1 loginuser=raw_input("please try again") if time <= 0: print "you have already tried three times please try in 10min" break loginpasswd=raw_input("please input your passwd") for i in range(3): if administrationinfo[loginuser]==loginpasswd: print "welcome" break else: time-=1 loginpasswd=raw_input("try again") time-=1 if time <= 0: print "you have already tried three times please try in 10min" break
阅读全文
0 0
- 练习小程序2
- 编程小练习(2)
- TCP小练习2
- 编程小练习2
- struts-2小练习
- 小练习2
- 操作系统小练习2
- 计算机网络小练习2
- 小练习2
- 小练习2
- linux小练习2
- C语言小练习 2
- Python小练习(2)
- 小练习
- 小练习
- 小练习
- 小练习
- 小练习
- MSB与LSB
- android倒计时获取验证码按钮
- 字符串——判断一个括号字符串是否匹配
- loadrunner打不开浏览器及各种卡死
- BZOJ 1176 [Balkan2007]Mokia [CDQ分治+树状数组]
- 小练习2
- python作业
- MFC获取文件夹路径并得到该字符串
- JZ2440的MMU内存管理单元
- Codeforces Round #413 C. Fountains(优先队列乱搞/树状数组/线段树)
- Android应用从后台切换到前台因为数据被GC报异常
- struts2环境搭建步骤
- 函数
- 欧拉角