知识点:模块导入  变量赋值的两种形式  格式化输出  for循环  if...else 嵌套

#!C:\Program Files\Python35/bin
# -*- conding:utf-8 -*-
# author: Frank
import getpass
user,passwd= 'Frank','oldboy_python'
msg = '''
Information of %s person:
NAME: %s
AGE: %s
JOB: %s
ID : %s
''' %(user,user, 21, 'IT Engineer',3714)
input_time = 1
for i in range(5):
print("-----input %d time-----" %int((input_time)))
username = input("please input your name:")
# password = getpass.getpass("please input your password:")
password = input("please input your password:")
if username == user and password == passwd :
print("%s Welcom to login on" %(user))
info_confirm = input("If you need double check your personal inform yes/no:")
if info_confirm == 'yes':
print(msg)
break
else:
print("please go ahead")
break
else :
if input_time == 3:
print("Your input has 3 times wrong , your account will be locked")
exit()
else:
print("Your user or password is invalid , pleasre re_input!")
input_time += 1

测试结果:

#测试1
-----input 1 time-----
please input your name:frank
please input your password:dmfkdf
Your user or password is invalid , pleasre re_input!
-----input 2 time-----
please input your name:frank
please input your password:kdf
Your user or password is invalid , pleasre re_input!
-----input 3 time-----
please input your name:Frkdfk
please input your password:msk
Your input has 3 times wrong , your account will be locked #测试2
-----input 1 time-----
please input your name:Frank
please input your password:oldboy_python
Frank Welcom to login on
If you need double check your personal inform yes/no:yes Information of Frank person:
NAME: Frank
AGE: 21
JOB: IT Engineer
ID : 3714 # 测试3:
-----input 1 time-----
please input your name:frak
please input your password:mksf34
Your user or password is invalid , pleasre re_input!
-----input 2 time-----
please input your name:mddif
please input your password:frank3235
Your user or password is invalid , pleasre re_input!
-----input 3 time-----
please input your name:Frank
please input your password:oldboy_python
Frank Welcom to login on
If you need double check your personal inform yes/no:no
please go ahead

Day01 login module的更多相关文章

  1. Centos6.5 登录时,提示Module is unkown

    前一段时间,因工作需要在物理机上装了一个Centos6.5,但是,用了一段时间,发现再登录时,无论如何也登不进去了,并且也不提示用户名或者密码错误.我一度以为是在profile以及.bashrc或者. ...

  2. [Vuex] Lazy Load a Vuex Module at Runtime using TypeScript

    Sometimes we need to create modules at runtime, for example depending on a condition. We could even ...

  3. [Firebase] 3. Firebase Simple Login Form

    Using $firebaseSimpleLogin service. Here we use three methods for login, logout, register and getCur ...

  4. js中的预加载与懒加载(延迟加载)

    js中加载分两种:预加载与延迟加载 一.  预加载,增强用户的体验,但会加载服务器的负担.一般会使用多种 CSS(background).JS(Image).HTML(<img />) . ...

  5. Nodejs学习笔记(七)--- Node.js + Express 构建网站简单示例

    目录 前言 新建项目.建立数据库以及其它准备工作 新建express + ejs 项目:sampleEjs 创建数据库 修改package.json文件,安装session和mysql模块 样式和JQ ...

  6. Spring学习笔记之整合struts

    1.现有项目是通过 <action    path="/aaaaAction"                type="org.springframework.w ...

  7. IOS使用APNS推送Payload字节数限制导致推送不成功

    这2天须要在推送上加上脚本,找到了badge方法能够加脚本.加上后可是怎么推送也不成功.郁闷了好久.在网上查找相关资料. 最终被我找到原因: "Payload--最多256bytes. &q ...

  8. Angular 2.0 从0到1 (七)

    第一节:Angular 2.0 从0到1 (一)第二节:Angular 2.0 从0到1 (二)第三节:Angular 2.0 从0到1 (三)第四节:Angular 2.0 从0到1 (四)第五节: ...

  9. ActiveMQ(5.10.0) - Configuring the JAAS Authentication Plug-in

    JAAS provides pluggable authentication, which means ActiveMQ will use the same authentication API re ...

随机推荐

  1. MAC下 mysql不能插入中文和中文乱码的问题总结

    MAC下 mysql不能插入中文和中文乱码的问题总结 前言 本文中所提到的问题解决方案,都是基于mac环境下的,但其他环境,比如windows应该也适用. 问题描述 本文解决下边两个问题: 往mysq ...

  2. 【需求设计1】VIP积分系统无聊YY

    RT,想到什么就写什么呗,这是最简单的方式,顺便给自己做一个记录,反正自己记忆力也不太好.本文是仿陆金所的积分系统,自己YY的一套东西. 首先我想做一个VIP兑换投资卷的功能: 我们先来确定一些我知道 ...

  3. C#项目中文件的具体含义

    1.Bin 目录 用来存放编译的结果,bin是二进制binary的英文缩写,因为最初C编译的程序文件都是二进制文件,它有Debug和Release两个版本,分别对应的文件夹为bin/Debug和bin ...

  4. NodeJs支付宝移动支付签名及验签

    非常感谢 :http://www.jianshu.com/p/8513e995ff3a?utm_campaign=hugo&utm_medium=reader_share&utm_co ...

  5. SAP CRM 树视图(TREE VIEW)

    树视图可以用于表示数据的层次. 例如:SAP CRM中的组织结构数据可以表示为树视图. 在SAP CRM Web UI的术语当中,没有像表视图(table view)或者表单视图(form view) ...

  6. Atitit.attilax软件研发与项目管理之道

    Atitit.attilax软件研发与项目管理之道 1. 前言4 2. 鸣谢4 3. Genesis 创世记4 4. 软件发展史4 5. 箴言4 6. 使徒行传 4 7. attilax书 4 8. ...

  7. MapReduce

    2016-12-21  16:53:49 mapred-default.xml mapreduce.input.fileinputformat.split.minsize 0 The minimum ...

  8. Lesson 18 He often does this!

    Text After I had had lunch at a village pub, I looked for my bag. I had left it on a chair beside th ...

  9. [翻译]AKKA笔记 -ACTOR SUPERVISION - 8

    失败更像是分布式系统的一个特性.因此Akka用一个容忍失败的模型,在你的业务逻辑与失败处理逻辑(supervision逻辑)中间你能有一个清晰的边界.只需要一点点工作,这很赞.这就是我们要讨论的主题. ...

  10. 【MSP是什么】MSP认证之成功的项目群管理

    同项目管理相比,项目群管理是为了实现项目群的战略目标与利益,而对一组项目进行的统一协调管理. 项目群管理 项目群管理是以项目管理为核心.单个项目上进行日常性的项目管理,项目群管理是对多个项目进行的总体 ...