Python Day-1 练习

作业1

要求:1.输入用户密码

        2.认真成功后显示欢迎信息

         3.输入三次锁定

代码如下:

__author__ = 'zhang.ning'
username = "zhangning"
password = "123456"
for i in  range(3):
    input_username = raw_input("Please your name:")
    input_password = raw_input("Please your password:")
    if (input_username == username and input_password == password ):
        print("welcome to centos world.")
        break
    else:
        print("have a try!")
else:
    print("Too many retrys !")
posted @ 2017-03-26 12:52  zhang.ning  阅读(119)  评论(0编辑  收藏  举报