python3.5学习之路_day1_用户登录

2017-01-12 07:46:22来源:cnblogs.com作者:gushiren人点击

 1 #!/usr/bin/env python 2 #_*_coding:utf-8_*_ 3 #by anthor zhangxiaoyu 2017-01-10 4 #blog:http://www.cnblogs.com/gushiren/ 5  6 import getpass 7 username = "zhangxiaoyu" 8 password = "www.123" 9 count = 310 for i in range(3):11         username = raw_input("/033[32mPlease enter your username:/033[0m")12         password = getpass.getpass("/033[32mPlease enter your password:/033[0m")13         if username == "zhangxiaoyu" and password == "www.123":14                 print "/033[33mlogin success,welcome %s login to system!/033[0m" % username15                 break16         else:17                 count -= 118                 print "Please type right user or password %s " % count

 

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台