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 !")