python脚本作业



作业:
创建一个python脚本,实现下面功能,
                 -
要求用户输入用户名和密码
         -
如果用户名和密码均不正确时,显示"welcomto user manage system"
         -
如果用户名和密码不正确时,重新输入,最多有三次机会;

         -
用户输入超过三次机会后,报错"你已经登陆过三次了,请10分钟以后再登陆"


#!/usr/bin/env python
#coding:utf-8
_author_ = "dwly"

'''
@author:dwly
@file:hello.py.py
@contact:[email protected]
@time:6/24/1711:58 PM
@desc:
'''
username = raw_input('username:')
password = raw_input('password:')
for i in range(0,3):
 
if (username=='root' andpassword=='redhat'):
     
print "welcom to user managesystem"
  
elif (username!='root' orpassword!='redhat'):
     
print"please inputagain"
     
break
 
elif i==4:
      print "you already login 3 t

你可能感兴趣的:(python脚本作业)