作业二:编写登陆接口

  • 输入用户名密码
  • 认证成功后显示欢迎信息
  • 输错三次后锁定
#!/usr/bin/env python
import getpass
def log():
	uname = input("input your uname:")
	upass = getpass.getpass("input your pass:")
	if uname == 'karyn' and upass == 'karyn':
		print("welcom login")
		exit(0)
	else:
		print("uname or upass invalid")
count=0
while True:
	log()
	count +=1
	if count>3:
		print("error too much")
		break

  

版权声明:本文为karyn原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/karyn/p/9211735.html