def updatePassword():
message=""
oldPwd=raw_input("Please input your old password:
").strip()
if(oldPwd != "python"):
message="原始密码输入出错,请重新输入吧"
sys.exit()
else:
newPwd = raw_input(u"请输入新的密码:
").strip()
if (len(newPwd)>6) and (len(newPwd)< 18):
renewPwd=raw_input(u"请输入确认密码:
").strip()
if (renewPwd != newPwd):
message="两次输入的密码不一致,密码修改失败"
sys.exit()
else:
message = "恭喜你,密码修改成功"
else:
message = "password : between 6 and 18"
return message
if __name__ == '__main__':
print updatePassword()